Comments (4)
The repo itself is a self-running example of grunt-contrib-jasmine and this template.
To aid in troubleshooting you can build the specrunner and open it in a browser, eg if your task is named "jasmineTest", run grunt jasmine:jasmineTest:build
and a _SpecRunner.html
file will be generated in your project's root.
It may be worthwhile to fork this repo and configure a template that suits your setup better. Requirejs configurations vary drastically from project to project and the more configuration you have the more custom your setup will need to be.
from grunt-template-jasmine-requirejs.
Okay, giving this a shot. It would definitely be helpful to see what order this lib is loading my scripts in and if it is finding them. I'm not sure where your "jasmineTest" is coming from though. I added a task called jasmineTest and linked it to ['jasmine'], but grunt doesn't like it:
➜ grunt-contrib-jasmine-example git:(master) ✗ grunt jasmine:jasmineTest:build
Running "jasmine:jasmineTest:build" (jasmine) task
Verifying property jasmine.jasmineTest exists in config...ERROR
>> Unable to process task.
Warning: Required config property "jasmine.jasmineTest" missing. Use --force to continue.
Aborted due to warnings.
So instead I removed the task and tried:
grunt jasmine:build
but no _SpecRunner.html was generated. Here is my Gruntfile.js if there's anything maybe you could flag as me being a durp:
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
meta : {
src : 'public/**/*.js',
specs : 'spec/**/*.js'
},
watch: {
test : {
files: ['<%= meta.src %>','<%= meta.specs %>'],
tasks: 'test'
}
},
jasmine : {
src : '<%= meta.src %>',
options : {
template: require('grunt-template-jasmine-requirejs'),
specs : '<%= meta.specs %>',
templateOptions: {
requireConfig: {
paths: {
Backbone: '/js/libs/backbone',
jQuery: '/js/libs/jquery',
Underscore: '/js/libs/underscore'
},
shim: {
'Backbone': ['Underscore', 'jQuery']
}
}
}
}
},
jshint: {
all: [
'Gruntfile.js',
'<%= meta.src %>',
'<%= meta.specs %>'
],
options: {
jshintrc: '.jshintrc'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('jasmineTest', ['jasmine']);
grunt.registerTask('test', ['jshint', 'jasmine']);
// Default task.
grunt.registerTask('default', ['test']);
};
from grunt-template-jasmine-requirejs.
I see you've opened and closed other repos related to grunt and the grunt 0.4.0 changes. Let me know if you still have issues configuring jasmine with the template.
from grunt-template-jasmine-requirejs.
Closing, let me know if there are further problems.
from grunt-template-jasmine-requirejs.
Related Issues (20)
- Script load reorder option HOT 1
- Empty `context.outfile` HOT 1
- Some errors are not caught correctly HOT 2
- Wait for the dom to be ready HOT 1
- Relative protocol not supported
- no polyfills HOT 2
- Vendor script with UMD makes require complain HOT 2
- PR 65 has had some interesting side-effects HOT 1
- Stack overflow when spec files are in sub folder of .grunt without sub folders HOT 1
- when spec file is in .grunt/grunt-contrib-jasmine the link to require.js starts with a slash
- Script files seem to be in a different order now HOT 5
- src/templates/jasmine-requirejs.html styles needs to support less HOT 2
- Add polyfills back in template HOT 1
- Error when using with requirejs-text plugin HOT 3
- Backslash in script path HOT 1
- Integrated with jasmine-jquery HOT 1
- Does not support Lodash 3+ HOT 1
- PhantomJS timed out HOT 2
- require.js file now being written to project root HOT 2
- Building error on version 12.2.0 on-prem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-template-jasmine-requirejs.