Commit 2027300c authored by Randall Leeds's avatar Randall Leeds

Remove a bunch more test boilerplate

Even when used as a CommonJS module, angular installs itself globally.
Rather than fight this in our tests, just leverage it. The mocks module
also installs itself under angular.mock. Therefore, none of the require
statements for angular or angular-mocks are necessary.
parent 5cbde100
{inject, module} = require('angular-mock')
{inject, module} = angular.mock
describe 'h:AccountController', ->
$scope = null
......
{inject, module} = require('angular-mock')
{inject, module} = angular.mock
sandbox = sinon.sandbox.create()
class MockSession
......
{module, inject} = require('angular-mock')
assert = chai.assert
{module, inject} = angular.mock
describe 'annotation', ->
$compile = null
......
{module, inject} = require('angular-mock')
assert = chai.assert
angular = require('angular')
{module, inject} = angular.mock
describe 'form-input', ->
$compile = null
......
{module, inject} = require('angular-mock')
assert = chai.assert
angular = require('angular')
{module, inject} = angular.mock
describe 'form-validate', ->
$compile = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'match', ->
$compile = null
......
{module, inject} = require('angular-mock')
assert = chai.assert
{module, inject} = angular.mock
VISIBILITY_KEY ='hypothesis.visibility'
VISIBILITY_PUBLIC = 'public'
......
{module, inject} = require('angular-mock')
assert = chai.assert
{module, inject} = angular.mock
describe 'share-dialog', ->
$scope = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'simple-search', ->
$compile = null
......
var angularMock = require('angular-mock');
var module = angularMock.module;
var inject = angularMock.inject;
var module = angular.mock.module;
var inject = angular.mock.inject;
describe('spinner', function () {
var $animate = null;
......
{module, inject} = require('angular-mock')
assert = chai.assert
{module, inject} = angular.mock
describe 'h:directives.status-button', ->
$scope = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'thread', ->
$compile = null
......
var angularMock = require('angular-mock');
var module = angularMock.module;
var inject = angularMock.inject;
var module = angular.mock.module;
var inject = angular.mock.inject;
describe('persona', function () {
var filter = null;
......
var angularMock = require('angular-mock');
var module = angularMock.module;
var inject = angularMock.inject;
var module = angular.mock.module;
var inject = angular.mock.inject;
describe('urlencode', function () {
var filter = null;
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'annotationMapper', ->
sandbox = sinon.sandbox.create()
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'AnnotationSync', ->
sandbox = sinon.sandbox.create()
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'AnnotationUIController', ->
$scope = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'AnnotationUISync', ->
sandbox = sinon.sandbox.create()
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'annotationUI', ->
annotationUI = null
......
{inject, module} = require('angular-mock')
{inject, module} = angular.mock
describe "AnnotationViewerController", ->
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'AppController', ->
$controller = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'h', ->
fakeAnnotator = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
Channel = require('jschannel')
describe 'Bridge', ->
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'CrossFrame', ->
sandbox = sinon.sandbox.create()
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'Discovery', ->
sandbox = sinon.sandbox.create()
......
"use strict";
var mock = require('angular-mock');
var mock = angular.mock;
describe('h:features', function () {
var $httpBackend;
......
{module, inject} = require('angular-mock')
angular = require('angular')
{module, inject} = angular.mock
describe 'form-respond', ->
$scope = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'host', ->
sandbox = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
sandbox = sinon.sandbox.create()
describe 'identityProvider', ->
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'localStorage', ->
fakeWindow = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'h:permissions', ->
sandbox = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'searchFilter', ->
sandbox = null
......@@ -8,7 +8,6 @@ describe 'searchFilter', ->
angular.module('h', [])
.service('searchFilter', require('../search-filter'))
beforeEach module('h')
beforeEach ->
......
"use strict";
var mock = require('angular-mock');
var mock = angular.mock;
describe('h:session', function () {
var $httpBackend;
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'store', ->
$httpBackend = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'StreamController', ->
$controller = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'streamer', ->
WebSocket = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'tags', ->
TAGS_LIST_KEY = 'hypothesis.user.tags.list'
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'Threading', ->
instance = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
minute = 60
hour = minute * 60
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'unicode', ->
unicode = null
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
poem =
tiger: 'Tiger! Tiger! burning bright
......
{module, inject} = require('angular-mock')
{module, inject} = angular.mock
describe 'WidgetController', ->
$scope = null
......
......@@ -66,7 +66,6 @@
"annotator": "./h/static/scripts/vendor/annotator.js",
"annotator-auth": "./h/static/scripts/vendor/annotator.auth.js",
"angular": "./h/static/scripts/vendor/angular.js",
"angular-mock": "./h/static/scripts/vendor/angular-mocks.js",
"dom-anchor-fragment": "./node_modules/dom-anchor-fragment/dist/dom-anchor-fragment.js",
"dom-anchor-text-position": "./node_modules/dom-anchor-text-position/dist/dom-anchor-text-position.js",
"dom-anchor-text-quote": "./node_modules/dom-anchor-text-quote/dist/dom-anchor-text-quote.js",
......@@ -97,7 +96,6 @@
"jquery"
]
},
"angular-mock": "global:angular.mock",
"dom-anchor-fragment": "domAnchorFragment",
"dom-anchor-text-position": {
"depends": [
......
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