Commit d82a52b9 authored by Robert Knight's avatar Robert Knight

Remove Angular template preprocessor from tests

Since components now require() their own templates, it is no longer
necessary to use a preprocessor to load them.
parent 25d03849
...@@ -322,7 +322,6 @@ describe('annotation', function() { ...@@ -322,7 +322,6 @@ describe('annotation', function() {
}); });
beforeEach(angular.mock.module('h')); beforeEach(angular.mock.module('h'));
beforeEach(angular.mock.module('h.templates'));
beforeEach(angular.mock.module(function($provide) { beforeEach(angular.mock.module(function($provide) {
sandbox = sinon.sandbox.create(); sandbox = sinon.sandbox.create();
......
'use strict'; 'use strict';
var angular = require('angular');
var assign = require('core-js/modules/$.object-assign'); var assign = require('core-js/modules/$.object-assign');
var util = require('./util'); var util = require('./util');
var excerpt = require('../excerpt'); var excerpt = require('../excerpt');
...@@ -32,7 +34,6 @@ describe('excerpt directive', function () { ...@@ -32,7 +34,6 @@ describe('excerpt directive', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
}); });
describe('enabled state', function () { describe('enabled state', function () {
......
'use strict'; 'use strict';
var events = require('../../events'); var angular = require('angular');
var groupList = require('../group-list'); var groupList = require('../group-list');
var util = require('./util'); var util = require('./util');
// returns true if a jQuery-like element has
// been hidden directly via an ng-show directive.
//
// This does not check whether the element is a descendant
// of a hidden element
function isElementHidden(element) {
return element.hasClass('ng-hide');
}
describe('groupList', function () { describe('groupList', function () {
var $rootScope; var $rootScope;
var $window; var $window;
...@@ -38,7 +30,6 @@ describe('groupList', function () { ...@@ -38,7 +30,6 @@ describe('groupList', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
}); });
beforeEach(angular.mock.inject(function (_$rootScope_, _$window_) { beforeEach(angular.mock.inject(function (_$rootScope_, _$window_) {
......
...@@ -60,7 +60,6 @@ describe('markdown', function () { ...@@ -60,7 +60,6 @@ describe('markdown', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
}); });
describe('read only state', function () { describe('read only state', function () {
......
'use strict'; 'use strict';
var angular = require('angular');
var util = require('./util'); var util = require('./util');
var fakeStorage = {}; var fakeStorage = {};
...@@ -26,7 +28,6 @@ describe('publishAnnotationBtn', function () { ...@@ -26,7 +28,6 @@ describe('publishAnnotationBtn', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
// create a new instance of the directive with default // create a new instance of the directive with default
// attributes // attributes
...@@ -38,7 +39,7 @@ describe('publishAnnotationBtn', function () { ...@@ -38,7 +39,7 @@ describe('publishAnnotationBtn', function () {
canPost: true, canPost: true,
isShared: false, isShared: false,
onSave: function () {}, onSave: function () {},
onSetPrivacy: function (level) {}, onSetPrivacy: function () {},
onCancel: function () {} onCancel: function () {}
}); });
}); });
......
...@@ -12,7 +12,6 @@ describe('searchStatusBar', function () { ...@@ -12,7 +12,6 @@ describe('searchStatusBar', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
}); });
context('when there is a filter', function () { context('when there is a filter', function () {
......
...@@ -10,7 +10,6 @@ describe 'share-dialog', -> ...@@ -10,7 +10,6 @@ describe 'share-dialog', ->
.directive('shareDialog', require('../share-dialog')) .directive('shareDialog', require('../share-dialog'))
beforeEach module('h') beforeEach module('h')
beforeEach module('h.templates')
beforeEach module ($provide) -> beforeEach module ($provide) ->
fakeCrossFrame = {frames: []} fakeCrossFrame = {frames: []}
......
'use strict'; 'use strict';
var angular = require('angular');
var util = require('./util'); var util = require('./util');
describe('sortDropdown', function () { describe('sortDropdown', function () {
...@@ -10,7 +12,6 @@ describe('sortDropdown', function () { ...@@ -10,7 +12,6 @@ describe('sortDropdown', function () {
beforeEach(function () { beforeEach(function () {
angular.mock.module('app'); angular.mock.module('app');
angular.mock.module('h.templates');
}); });
it('should update the sort mode on click', function () { it('should update the sort mode on click', function () {
......
...@@ -43,12 +43,6 @@ module.exports = function(config) { ...@@ -43,12 +43,6 @@ module.exports = function(config) {
exclude: [ exclude: [
], ],
// strip templates of leading path
ngHtml2JsPreprocessor: {
moduleName: 'h.templates',
cacheIdFromPath: path.basename
},
// preprocess matching files before serving them to the browser // preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: { preprocessors: {
...@@ -56,7 +50,6 @@ module.exports = function(config) { ...@@ -56,7 +50,6 @@ module.exports = function(config) {
'./test/bootstrap.js': ['browserify'], './test/bootstrap.js': ['browserify'],
'**/*-test.js': ['browserify'], '**/*-test.js': ['browserify'],
'**/*-test.coffee': ['browserify'], '**/*-test.coffee': ['browserify'],
'../../templates/client/*.html': ['ng-html2js'],
}, },
browserify: { browserify: {
......
...@@ -30,7 +30,6 @@ describe 'loginForm.Controller', -> ...@@ -30,7 +30,6 @@ describe 'loginForm.Controller', ->
.controller('loginFormController', require('../directive/login-form').Controller) .controller('loginFormController', require('../directive/login-form').Controller)
beforeEach module('h') beforeEach module('h')
beforeEach module('h.templates')
beforeEach module ($provide) -> beforeEach module ($provide) ->
$provide.value '$timeout', sandbox.spy() $provide.value '$timeout', sandbox.spy()
......
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
"karma-browserify": "^3.0.3", "karma-browserify": "^3.0.3",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",
"karma-mocha": "^0.1.4", "karma-mocha": "^0.1.4",
"karma-ng-html2js-preprocessor": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.4", "karma-phantomjs-launcher": "^0.1.4",
"karma-sinon": "^1.0.4", "karma-sinon": "^1.0.4",
"mocha": "^1.20.1", "mocha": "^1.20.1",
......
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