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
I am running into a situation when using requirejs for my test, using the method provided here https://karma-runner.github.io/0.8/plus/RequireJS.html. I am encountering the following error(s), in VS Output ========== Discover test finished: 1 found (0:00:02.2382238) ========== ------ Run test started ------ An exception occurred while invoking executor 'executor://karmatestadapter/': One or more errors occurred. Value cannot be null. Parameter name: values ========== Run test finished: 0 run (0:00:00.1090109) ========== and in a browser (like chrome) Error: Module name "../App/Password/password" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded require.js:165:17 load complete
my main.test.js ```var allTestFiles = [];
var TEST_REGEXP = /UnitTests/.*.js$/;
var pathToModule = function (path) {
var returnValue = path.replace(/^/base//, '').replace(/.js$/, '');
return returnValue;
};
Object.keys(window.karma.files).forEach(function (file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTestFiles.push(pathToModule(file));
}
});
requirejs.config({
// Karma serves files from '/base'
baseUrl: '/base',
deps: allTestFiles,
paths: {
'jquery.mockjax': 'Libraries/jquery.mockjax/jquery.mockjax'
},
shim: {
'jquery.mockjax': {
deps: ['jquery'],
init: function (m) { }
}
},
// start test run, once Require.js is done
callback: function () {
console.log('load complete');
window.__karma__.start();
}
});
The text was updated successfully, but these errors were encountered:
I am running into a situation when using requirejs for my test, using the method provided here https://karma-runner.github.io/0.8/plus/RequireJS.html. I am encountering the following error(s), in VS Output
========== Discover test finished: 1 found (0:00:02.2382238) ========== ------ Run test started ------ An exception occurred while invoking executor 'executor://karmatestadapter/': One or more errors occurred. Value cannot be null. Parameter name: values ========== Run test finished: 0 run (0:00:00.1090109) ==========
and in a browser (like chrome)Error: Module name "../App/Password/password" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded require.js:165:17 load complete
my main.test.js ```var allTestFiles = [];
var TEST_REGEXP = /UnitTests/.*.js$/;
var pathToModule = function (path) {
var returnValue = path.replace(/^/base//, '').replace(/.js$/, '');
return returnValue;
};
Object.keys(window.karma.files).forEach(function (file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTestFiles.push(pathToModule(file));
}
});
requirejs.config({
// Karma serves files from '/base'
baseUrl: '/base',
});
The text was updated successfully, but these errors were encountered: