Commit fa6b17e7 authored by Randall Leeds's avatar Randall Leeds

Merge pull request #1998 from hypothesis/move-frontend-tests

Move frontend tests alongside tested modules
parents 81774ae7 262d9e2a
......@@ -19,7 +19,7 @@ describe 'h:AccountController', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/account/account-controller')
require('../account-controller')
beforeEach module('h')
......
......@@ -29,7 +29,7 @@ describe 'h:AuthController', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/account/auth-controller')
require('../auth-controller')
beforeEach module('h')
beforeEach module('h.templates')
......
bb = require('../../../../h/static/scripts/annotator/plugin/bucket-bar')
bb = require('../bucket-bar')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
cf = require('../../../../h/static/scripts/annotator/plugin/cross-frame')
cf = require('../cross-frame')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
ea = require('../../../h/static/scripts/annotator/plugin/enhancedanchoring')
ea = require('../enhancedanchoring')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
th = require('../../../h/static/scripts/annotator/plugin/texthighlights')
th = require('../texthighlights')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
......@@ -25,7 +25,7 @@ describe 'h.directives.annotation', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/annotation')
require('../annotation')
beforeEach module('h')
beforeEach module('h.templates')
......
......@@ -16,7 +16,7 @@ describe 'h.directives.privacy', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/privacy')
require('../privacy')
beforeEach module('h')
beforeEach module('h.templates')
......
......@@ -12,7 +12,7 @@ describe 'h:directives.simple-search', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/simple-search')
require('../simple-search')
beforeEach module('h')
......
......@@ -10,7 +10,7 @@ describe 'h:directives.status-button', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/status-button')
require('../status-button')
beforeEach module('h')
......
......@@ -10,7 +10,7 @@ describe 'h:directives.thread', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/thread')
require('../thread')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'h.helpers:form-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/form-helpers')
require('../form-helpers')
beforeEach module('h.helpers')
......
......@@ -9,7 +9,7 @@ describe 'h.helpers:string-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/string-helpers')
require('../string-helpers')
beforeEach module('h.helpers')
......
......@@ -44,7 +44,7 @@ describe 'h.helpers:time-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/time-helpers')
require('../time-helpers')
beforeEach module('h.helpers')
......
......@@ -12,7 +12,7 @@ describe 'h.session', ->
before ->
angular.module('h.session', ['ngResource'])
require('../../h/static/scripts/session/session-service')
require('../session-service')
beforeEach module('h.session')
......
......@@ -14,7 +14,7 @@ describe 'AnnotationMapperService', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-mapper-service')
require('../annotation-mapper-service')
beforeEach module('h')
beforeEach module ($provide) ->
......
......@@ -15,7 +15,7 @@ describe 'AnnotationSync', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-sync')
require('../annotation-sync')
beforeEach module('h')
beforeEach inject (AnnotationSync, $rootScope) ->
......
......@@ -9,7 +9,7 @@ describe 'AnnotationUI', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-ui-service')
require('../annotation-ui-service')
beforeEach module('h')
beforeEach inject (_annotationUI_) ->
......
......@@ -18,7 +18,7 @@ describe 'AnnotationUISync', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-ui-sync')
require('../annotation-ui-sync')
beforeEach module('h')
beforeEach inject (AnnotationUISync, $rootScope) ->
......
......@@ -11,7 +11,7 @@ describe 'h', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/auth-service')
require('../auth-service')
beforeEach module('h')
......
{module, inject} = require('angular-mock')
Channel = require('../../h/static/scripts/vendor/jschannel.js')
Channel = require('../vendor/jschannel.js')
assert = chai.assert
sinon.assert.expose assert, prefix: null
......@@ -12,7 +12,7 @@ describe 'Bridge', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/bridge')
require('../bridge')
beforeEach module('h')
beforeEach inject (Bridge) ->
......
......@@ -7,7 +7,7 @@ sinon.assert.expose assert, prefix: null
describe 'h:controllers', ->
before ->
angular.module('h', ['ngRoute'])
require('../../h/static/scripts/controllers')
require('../controllers')
describe 'AppController', ->
$scope = null
......
......@@ -19,7 +19,7 @@ describe 'CrossFrameService', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/cross-frame-service')
require('../cross-frame-service')
beforeEach module('h')
beforeEach module ($provide) ->
......
......@@ -6,7 +6,7 @@ assert = chai.assert
describe 'h:directives', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/directives')
require('../directives')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'Discovery', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/discovery')
require('../discovery')
beforeEach module('h')
beforeEach inject (Discovery) ->
......
......@@ -7,7 +7,7 @@ describe 'h:filters', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/filters')
require('../filters')
describe 'persona', ->
filter = null
......
Annotator = require('annotator')
Guest = require('../../h/static/scripts/guest')
Guest = require('../guest')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
Host = require('../../h/static/scripts/host')
Host = require('../host')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
......@@ -10,7 +10,7 @@ describe 'h.identity', ->
mockInjectable = {}
before ->
require('../../h/static/scripts/identity-service')
require('../identity-service')
beforeEach module('h.identity')
......
......@@ -10,7 +10,7 @@ describe 'h:permissions', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/permissions-service')
require('../permissions-service')
beforeEach module('h')
......
......@@ -22,7 +22,7 @@ describe 'h:services', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/services')
require('../services')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'store', ->
before ->
angular.module('h', ['ngResource'])
require('../../h/static/scripts/store-service')
require('../store-service')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'streamer', ->
sandbox = null
before ->
require('../../h/static/scripts/streamer-service')
require('../streamer-service')
beforeEach module('h.streamer')
......
......@@ -9,7 +9,7 @@ describe 'Threading', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/threading-service')
require('../threading-service')
beforeEach module('h')
......
// Karma configuration
// Generated on Mon Jul 14 2014 14:06:50 GMT+0200 (CEST)
var path = require('path');
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
basePath: 'h/static/scripts',
// frameworks to use
......@@ -19,34 +20,34 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
// Application external deps
'h/static/scripts/vendor/jquery.js',
'h/static/scripts/vendor/angular.js',
'h/static/scripts/vendor/angular-animate.js',
'h/static/scripts/vendor/angular-bootstrap.js',
'h/static/scripts/vendor/angular-resource.js',
'h/static/scripts/vendor/angular-route.js',
'h/static/scripts/vendor/angular-sanitize.js',
'h/static/scripts/vendor/ng-tags-input.js',
'h/static/scripts/vendor/annotator.js',
'h/static/scripts/vendor/polyfills/autofill-event.js',
'h/static/scripts/vendor/polyfills/bind.js',
'h/static/scripts/vendor/katex/katex.js',
'h/static/scripts/vendor/moment-with-langs.js',
'h/static/scripts/vendor/jstz.js',
'h/static/scripts/vendor/moment-timezone.js',
'h/static/scripts/vendor/moment-timezone-data.js',
'h/static/scripts/vendor/polyfills/url.js',
'vendor/jquery.js',
'vendor/angular.js',
'vendor/angular-animate.js',
'vendor/angular-bootstrap.js',
'vendor/angular-resource.js',
'vendor/angular-route.js',
'vendor/angular-sanitize.js',
'vendor/ng-tags-input.js',
'vendor/annotator.js',
'vendor/polyfills/autofill-event.js',
'vendor/polyfills/bind.js',
'vendor/katex/katex.js',
'vendor/moment-with-langs.js',
'vendor/jstz.js',
'vendor/moment-timezone.js',
'vendor/moment-timezone-data.js',
'vendor/polyfills/url.js',
// Test deps
'h/static/scripts/vendor/angular-mocks.js',
'h/static/scripts/vendor/polyfills/promise.js',
'h/static/scripts/vendor/sinon.js',
'h/static/scripts/vendor/chai.js',
'h/templates/client/*.html',
'tests/js/bootstrap.coffee',
'vendor/angular-mocks.js',
'vendor/polyfills/promise.js',
'vendor/sinon.js',
'vendor/chai.js',
'../../templates/client/*.html',
'test/bootstrap.coffee',
// Tests
'tests/js/**/*-test.coffee',
'**/*-test.coffee'
],
......@@ -57,14 +58,14 @@ module.exports = function(config) {
// strip templates of leading path
ngHtml2JsPreprocessor: {
moduleName: 'h.templates',
stripPrefix: 'h/templates/client/'
cacheIdFromPath: path.basename
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'**/*.coffee': ['browserify'],
'h/templates/client/*.html': ['ng-html2js'],
'../../templates/client/*.html': ['ng-html2js'],
},
browserify: {
......
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