You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
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):
Create a folder named "unit-tests" in root of the project and move all tests in to that folder.
Then replace following line in "require-config.js" return path.replace(/^\/base\/app\//, '').replace(/\.js$/, '');
with this line. return path.replace(/^\/base\/unit-tests\//, '../unit-tests/').replace(/\.js$/, '');
Include this line at a bottom of files section in "karma.conf.js" file {pattern: 'unit-tests/*.js', included: false},
I also created a project which I use for my own developments.You can check it Here
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
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):
The text was updated successfully, but these errors were encountered: