New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with jasmine adapter ? #486
Comments
Weird, I have no idea. The error says, that Jasmine passed a spec object Can you go to http://localhost:9876/debug.html and see if there is any V. On Wed, Apr 10, 2013 at 12:03 PM, Ignacio Rivas notifications@github.comwrote:
|
After a few hours debugging, i realized that i had a problem with my spec-main.js file. It's working now! 💃 |
Hi @sabarasaba, It seems that I encounter the same problem, only that it happens when I'm using Squire.js with it. Could you tell us what was wrong in your spec-main.js file? |
I dont really remember what was it, it think it was a problem with the function that returns the spec-files. Heres what we're doing now in our spec-main.js: var tests = Object.keys(window.__karma__.files).filter(function (file) {
return /spec\.js$/.test(file);
});
requirejs.config({
// Karma serves files from '/base'
baseUrl: '/base/www/js',
paths: {
'jquery' : 'vendor/jquery/jquery-1.9.1',
'underscore' : 'vendor/underscore/lodash',
'backbone' : 'vendor/backbone/backbone',
'handlebars' : 'vendor/handlebars/handlebars',
'i18next' : 'vendor/i18next/i18next.amd.withJQuery',
'postal' : 'vendor/postal/postal'
},
shim: {
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'handlebars': {
exports : 'Handlebars'
}
},
// ask Require.js to load these files (all our tests)
deps: tests,
// start test run, once Require.js is done
callback: window.__karma__.start
}); Regards. |
Well it seems I've got the same sort of config. Thanks for the help! I'll probably raise an issue onto Squire.js as it seems to be the cause. |
@FabienDeshayes were you able to resolve this? I'm running into the same issue while trying to use Squire. |
Yes, I fixed it. Basically as I'm using Require.js I had to change my test-main.js: instead of defining require(tests, function() {
window.__karma__.start();
}); For info, my test looks like that: define(['Squire'], function(Squire) {
describe('Food', function() {
var async = new AsyncSpec(this);
var injector = new Squire();
var food;
async.beforeEach(function(done) {
injector
.mock('nutrient', 'fat')
.require(['food'], function(module) {
food = module;
done();
});
});
it("should have fat", function() {
// expects...
});
it("should be a pizza", function() {
// expects...
});
afterEach(function() {
injector.clean('nutrient');
});
});
}); |
Hello, I had the same problem, and the real solution for me was that the filter was not ok: the regular expression also included the initial boot file, in your example "test-main.js". So when making sure this was not added to the "deps" it worked. |
Thanks! I had the exact same problem (using karma, jasmine, require.js, and squire) and this fix worked for me. Does anyone have any idea what the underlying issue is here? |
JASMINE is not defined |
@aleksandrj1 JASMINE variable was removed, use Thanks |
Hey! I created a new project with require and jasmine, but karma keeps throwing me this error and I dont really know where else to look. Maybe you guys can help me out. So the error that im getting is:
And the spec that im executing is pretty simple:
And my karma.conf looks like this:
Thanks!
Update: If I change the browsers property to 'Chrome' in the chrome console I get:
The text was updated successfully, but these errors were encountered: