I change the code, extend some functionality and add new unittest for that. Now, when I run my unit tests with karma (test framework - jasmine), it throw me an error
'There is no timestamp for /libs/angular-bootstrap/ui-bootstrap-tpls.js!'
Uncaught Error: Script error for: angular-bootstrap
.html#scripterror
at http://localhost:9876/base/node_modules/karma-requirejs/lib/require.js?1379984163000:138
What I'm doing wrong?
I change the code, extend some functionality and add new unittest for that. Now, when I run my unit tests with karma (test framework - jasmine), it throw me an error
'There is no timestamp for /libs/angular-bootstrap/ui-bootstrap-tpls.js!'
Uncaught Error: Script error for: angular-bootstrap
http://requirejs/docs/errors.html#scripterror
at http://localhost:9876/base/node_modules/karma-requirejs/lib/require.js?1379984163000:138
What I'm doing wrong?
Share Improve this question edited Sep 25, 2013 at 23:42 Ph0en1x asked Sep 25, 2013 at 22:51 Ph0en1xPh0en1x 10.1k8 gold badges55 silver badges97 bronze badges 2- 1 Can you add the karma config file? – busypeoples Commented Sep 25, 2013 at 23:11
- update the question's body – Ph0en1x Commented Sep 25, 2013 at 23:16
3 Answers
Reset to default 3It was my mistake pletely. when using karma-requirejs
you have main-test.js
file where configure how to require.js
get the files. I add reference to angular-bootstrap with mistake, that's why require.js
couldn't find this file and throwing this mistake. So in my case this error means wrong file name provided.
It can be because it cannot access your source file. You should configure karma to serve scripts where require will look for them. For example have the config in the karma conf
files:[{pattern: 'node_modules/**/*.js', included:false}]
The question is old, the OP already solved his problem by now, but I'll add my two cents:
From the error message (end of the first error line) we can conclude that you were including a paths
(or deps
) file in main-test.js
with the .js
extension.
In RequireJS, you need to call the file names without the extension, so your paths
(or deps
) would look more or less like this:
paths: {
'ui-bootstrap': 'libs/angular-bootstrap/ui-bootstrap-tpls' // <- without the extension
}