This repository was archived by the owner on Jul 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 283
This repository was archived by the owner on Jul 6, 2019. It is now read-only.
How to move tests into different area? #40
Copy link
Copy link
Open
Description
I love the angularjs-requirejs seed, and have used it several times for a number of projects. For my current project, I'm required to move the tests OUT of the main code-base. I've tried a number of ways to add tests to a separate area, but then I get errors like this:
ERROR [karma]: Uncaught Error: Mismatched anonymous define() module: function (app) {
describe('app.version module', function() {
beforeEach(module('app.version'));
describe('app-version directive', function() {
it('should print current version', function() {
module(function($provide) {
$provide.value('version', 'TEST_VER');
});
inject(function($compile, $rootScope) {
var element = $compile('<span app-version></span>')($rootScope);
expect(element.text()).toEqual('TEST_VER');
});
});
});
});
}
http://requirejs.org/docs/errors.html#mismatch
at http://localhost:9876/absoluteC:/Users/zzz/zzz/node_modules/requirejs/require.js?3d820c829606b74b8680ffd0416fdb96d16ec957:141
I know that the project/test environment is correct, because when I move the tests back to their native folders, everything works okay. Here's a sample karma.conf (relevant parts):
basePath : './public',
files : [
{pattern: 'libs/angular/angular.js', included: false},
{pattern: 'libs/angular-mocks/angular-mocks.js', included: false},
{pattern: 'libs/angular-translate/angular-translate.min.js', included: false},
{pattern: 'libs/angular-bootstrap/ui-bootstrap.min.js', included: false},
{pattern: 'libs/angular-ui-router/release/angular-ui-router.js', included: false},
{pattern: 'libs/requirejs-text/text.js', included: false},
{pattern: 'app/shared/version/*.js', included: false},
{pattern: 'app/service/*.js', included: false},
{pattern: 'app/model/*.js', included: false},
{pattern: 'app.js', included: false},
{pattern: 'test/*.js', included: true},
'require-config.js'
],
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels