Last active
March 12, 2018 18:38
-
-
Save sorin-postelnicu/02ca666b8ac17adc5e614db5dc9730c5 to your computer and use it in GitHub Desktop.
Uncaught Error when trying to use jasmine-expect with jasmine2 and requirejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Jasmine Spec Runner v2.4.1</title> | |
<link rel="stylesheet" href="../lib/jasmine_2.4.1/jasmine.css"> | |
<script data-main="specs.main" src="../lib/requirejs/require.min.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
var jquery = require('jquery'); | |
describe('Example spec', function() { | |
describe('type', function() { | |
it('should be array', function() { | |
var a = []; | |
expect(a).toBeArray(); | |
}); | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirejs.config({ | |
paths: { | |
app: '../app', | |
jquery: '../lib/jquery/jquery.min', | |
modernizr: '../lib/modernizr/modernizr-custom.min', | |
localStorage: '../lib/localStorage/localStorage', | |
jasmine: ['../lib/jasmine_2.4.1/jasmine'], | |
'jasmine-html': ['../lib/jasmine_2.4.1/jasmine-html'], | |
'jasmine-boot': ['../lib/jasmine_2.4.1/boot'], | |
'jasmine-jquery': ['../lib/jasmine-jquery/lib/jasmine-jquery'], | |
'jasmine-ajax': ['../lib/jasmine-ajax/lib/mock-ajax'], | |
'jasmine-add-matchers': ['../lib/jasmine-add-matchers/dist/add-matchers'], | |
'jasmine-expect': ['../lib/jasmine-expect/dist/jasmine-matchers'] | |
}, | |
shim: { | |
'modernizr': {}, | |
'jasmine-html': { | |
deps: ['jasmine'] | |
}, | |
'jasmine-boot': { | |
deps: ['jasmine', 'jasmine-html'] | |
}, | |
'jasmine-jquery': { | |
deps: ['jasmine', 'jasmine-html', 'jasmine-boot', 'jquery'] | |
}, | |
'jasmine-ajax': { | |
deps: ['jasmine', 'jasmine-html', 'jasmine-boot'] | |
}, | |
'jasmine-add-matchers': { | |
deps: ['jasmine'] | |
}, | |
'jasmine-expect': { | |
deps: ['jasmine', 'jasmine-add-matchers'] | |
} | |
} | |
}); | |
require(['jasmine', 'jasmine-boot', 'jasmine-html', 'jasmine-add-matchers', 'jasmine-expect', 'jasmine-jquery', 'jasmine-ajax'], function() { | |
require([ | |
'app/mymodule/mycomponent.spec', | |
'app/myothermodule/myothercomponent.spec' | |
], function() { | |
window.onload(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment