Skip to content

Instantly share code, notes, and snippets.

@jrhorn424
Last active August 29, 2015 14:16
Show Gist options
  • Save jrhorn424/de8ff5ccea8e53d777f0 to your computer and use it in GitHub Desktop.
Save jrhorn424/de8ff5ccea8e53d777f0 to your computer and use it in GitHub Desktop.
Getting jasmine-jquery to work with karma
[project root]
├── app/
│   ├── js/
│   │   └── app.js
│   └── index.html
├── test/
│   ├── spec/
│   │   ├── fixtures/
│   │   │   ├── todo.html
│   │   ├── helper.js
│   │   └── todo_spec.js
│   └── karma.conf.js
'use strict';
var fixtures = jasmine.getFixtures();
fixtures.fixturesPath = '/base/test/spec/fixtures';
'use strict';
module.exports = function(config) {
// ...
config.set({
// ... from the README
frameworks: ['jasmine-jquery', 'jasmine'],
files: [
// ... ,
'test/spec/fixtures/**/*.html'
],
plugins: [
// ... ,
'karma-jasmine-jquery'
],
// ...
});
};
<input type='text' id='new-todo'>
<ul id='todos'>
</ul>
'use strict';
describe('todo', function () {
beforeEach(function () {
loadFixtures('todo.html');
});
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment