Fixtures not loaded through 'jasmine-jquery'
See original GitHub issueI’m trying to integrate Karma in a Backbone.js app. I’m using Jamine as Testing framework and jasmine-jquery as an extension. I’ve got a few fixtures (html and json) into the spec/javascript/fixtures folder and part of my karma.conf file looks like this:
// list of files / patterns to load in the browser
files = [
JASMINE,
JASMINE_ADAPTER,
'public/javascripts/vendor/jquery.js',
'public/javascripts/vendor/underscore-1.4.3.js',
'public/javascripts/vendor/json2.js',
'public/javascripts/vendor/backbone-0.9.2.js',
'public/javascripts/**/*.js',
'spec/javascripts/spec-helper.js',
'spec/javascripts/support/jasmine-jquery-1.2.0.js',
'spec/javascripts/support/jasmine-underscore.js',
'spec/javascripts/support/sinon-1.1.1.js',
'spec/javascripts/**/*.js',
{
pattern: 'spec/javascripts/fixtures/**/*.html',
watched: true,
included: false,
served: true
},
{
pattern: 'spec/javascripts/fixtures/*.json',
watched: true,
included: false,
served: true
}
];
In my spec-helper.js, I try to load the fixture with
'readFixtures("reference-data.json")'
and I start karma
karma start
I get that the fixture is not loaded and if I debug in the browser opened by Karma I get a 404 for the /spec/javascripts/fixtures/reference-data.json
resource.
Missing anything?
Issue Analytics
- State:
- Created 10 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
jasmine-jquery won't load any fixture - Stack Overflow
The fixtures need to be defined in the files list in karma.conf.js. Karma serves the files under the /base directory: ...
Read more >Can't load HTML fixtures using jasmine-jquery : RSRP-337363
jasmine -jquery library https://github.com/velesin/jasmine-jquery provides a way to load HTML fixtures from external files. Unfortunately it does not load ...
Read more >Loading External Fixtures with the Jasmine-jQuery Library
In today's tutorial, we used the jasmine-jquery library's set() function to provide a pre-initialized fixture. In the next instalment, ...
Read more >HTML fixtures in Jasmine (using jasmine-jquery)
The most straightforward way is just to create a “fixture” jQuery element inside your spec, invoke your plugin on it and then set...
Read more >[Solved]-Fixtures won't load in Karma-grunt.js
add it as a framework - frameworks: ['jasmine-jquery', 'jasmine'] · include your fixtures as patterns under the files array - { pattern: 'test/fixtures/*....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just FYI, the karma object is exposed as
window.__karma__
notwindow.karma
.You can test if you are using karma, e.g.