Commit 5cbde100 authored by Randall Leeds's avatar Randall Leeds

Really remove the sinon and chai boilerplate

It turns out we don't need Sinon-Chai because we only use the assert
interface. According to the Sinon-Chai docs:

    For assert interface there is no need for this library.

Instead, we just install the assertions into the assert object.
parent 01c75593
......@@ -4,10 +4,6 @@ Guest = require('../guest')
anchoring = require('../anchoring/html')
highlighter = require('../highlighter')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
waitForSync = (annotation) ->
if annotation.$anchors?
return Promise.resolve()
......
......@@ -3,10 +3,6 @@ $ = Annotator.$
highlighter = require('../highlighter')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
describe "highlightRange", ->
it 'wraps a highlight span around the given range', ->
txt = document.createTextNode('test highlight span')
......
{module, inject} = require('angular-mock')
assert = chai.assert
describe 'simple-search', ->
$compile = null
$element = null
......@@ -50,15 +47,15 @@ describe 'simple-search', ->
isolate.searchtext = "Test query"
isolate.$digest()
$element.find('form').triggerHandler('submit')
sinon.assert.calledWith($scope.update, "Test query")
assert.calledWith($scope.update, "Test query")
it 'invokes callbacks when the input model changes', ->
$scope.query = "Test query"
$scope.$digest()
sinon.assert.calledOnce($scope.update)
assert.calledOnce($scope.update)
$scope.query = ""
$scope.$digest()
sinon.assert.calledOnce($scope.clear)
assert.calledOnce($scope.clear)
it 'adds a class to the form when there is no input value', ->
$form = $element.find('.simple-search-form')
......
......@@ -2,9 +2,6 @@ var angularMock = require('angular-mock');
var module = angularMock.module;
var inject = angularMock.inject;
var assert = chai.assert;
sinon.assert.expose(assert, {prefix: null});
describe('persona', function () {
var filter = null;
var term = 'acct:hacker@example.com';
......
......@@ -2,9 +2,6 @@ var angularMock = require('angular-mock');
var module = angularMock.module;
var inject = angularMock.inject;
var assert = chai.assert;
sinon.assert.expose(assert, {prefix: null});
describe('urlencode', function () {
var filter = null;
......
......@@ -12,7 +12,8 @@ module.exports = function(config) {
frameworks: [
'browserify',
'mocha',
'chai-sinon'
'chai',
'sinon'
],
// list of files / patterns to load in the browser
......@@ -40,6 +41,7 @@ module.exports = function(config) {
// Test deps
'vendor/angular-mocks.js',
'../../templates/client/*.html',
'test/bootstrap.js',
// Tests
'**/*-test.coffee',
......
describe('parseUrl', function () {
'use strict';
var assert = chai.assert;
var blocklist = require('../blocklist');
var parseUrl = blocklist.parseUrl;
......
// Expose the sinon assertions.
sinon.assert.expose(assert, {prefix: null});
......@@ -2,10 +2,6 @@
var mock = require('angular-mock');
var assert = chai.assert;
sinon.assert.expose(assert, {prefix: null});
describe('h:features', function () {
var $httpBackend;
var features;
......
{module, inject} = require('angular-mock')
assert = chai.assert
angular = require('angular')
......
{module, inject} = require('angular-mock')
assert = chai.assert
describe 'tags', ->
TAGS_LIST_KEY = 'hypothesis.user.tags.list'
TAGS_MAP_KEY = 'hypothesis.user.tags.map'
......
{module, inject} = require('angular-mock')
assert = chai.assert
minute = 60
hour = minute * 60
day = hour * 24
......
......@@ -29,11 +29,12 @@
"jscs": "^1.13.1",
"karma": "^0.12.17",
"karma-browserify": "^3.0.3",
"karma-chai-sinon": "^0.1.5",
"karma-chai": "^0.1.0",
"karma-cli": "0.0.4",
"karma-mocha": "^0.1.4",
"karma-ng-html2js-preprocessor": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.4",
"karma-sinon": "^1.0.4",
"mocha": "^1.20.1",
"phantomjs": "^1.9.7",
"sinon": "^1.15.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment