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 was looking for a way to use my complex JSON file to test my responses then I found this karma-fixture project. However, it doesn't work the installation process that you put in your README. I wonder someone can help me to find my mistake or the bug in the way is included.
$ grunt jshint:test
Running "jshint:test" (jshint) task
test/spec/controllers/main.js
line 17 col 20 'fixture' is not defined.
line 28 col 9 'fixture' is not defined.
Here is my Karma.conf.js file
module.exports = function(config) {
'use strict';
config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// base path, that will be used to resolve files and exclude
basePath: '../',
preprocessors: {
"test/json/*.json" : ["json_fixtures"]
},
jsonFixturesPreprocessor: {
variableName: "__json__"
},
// testing framework to use (jasmine/mocha/qunit/...)
// as well as any additional frameworks (requirejs/chai/sinon/...)
frameworks: [
"fixture",
"jasmine"
],
// list of files / patterns to load in the browser
files: [
// bower:js
...
// endbower
"app/scripts/**/*.js",
"test/mock/**/*.js",
"test/spec/**/*.js",
{
pattern: 'test/json/*',
}
],
// list of files / patterns to exclude
exclude: [
],
// web server port
port: 8080,
...
browsers: [
"PhantomJS"
],
// Which plugins to enable
plugins: [
'karma-fixture',
'karma-json-fixtures-preprocessor',
"karma-phantomjs-launcher",
"karma-jasmine"
],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
colors: true,
logLevel: config.LOG_INFO,
});
};
Hi @billtrik Great to hear from you. I did how you said but it doesn't work for me. I use yeoman angular to create my repository
npm install -g yo grunt-cli bower npm install -g generator-angular yo angular
I get it working using jasmine-jquery so I didn't do more research in this area. It seen I couldn't find the fixture class name. I tried too to change the order of the includes in case I did a mistake. I would like to do more research. It probably take some time because I'm not familiar with Coffee script.
On the other hand, I also get a error from "Before(function(){...});" so I changed for before each.
Hi
I was looking for a way to use my complex JSON file to test my responses then I found this karma-fixture project. However, it doesn't work the installation process that you put in your README. I wonder someone can help me to find my mistake or the bug in the way is included.
Here is my Karma.conf.js file
and here is my test file
The text was updated successfully, but these errors were encountered: