requirejs - using require() in karma tests -
i'm using karma 0.12.28, karma-requirejs 0.2.2 (and karam-jasmine) run tests. config identical 1 docs (test files in requirejs deps , window.__ karma __.start
callback). works fine basic tests. problem starts when use require()
instead of define()
or try change context. this:
var ctx = require.config({ context: 'my-context' }); ctx(['dep1'], function(){ //.... });
the problem dep1 fails load. in devtools can see <script/>
created , can see request in network tab proper url status canceled. can open url using context menu i'm sure correct question remains - why can't use require()
in karma tests?
Comments
Post a Comment