gruntjs / grunt-contrib-jasmine Goto Github PK
View Code? Open in Web Editor NEWRun jasmine specs headlessly through Headless Chrome
Home Page: http://gruntjs.com/
License: MIT License
Run jasmine specs headlessly through Headless Chrome
Home Page: http://gruntjs.com/
License: MIT License
I made a new grunt-toolchain branch for Patterns to switch it to using grunt. I have this working with grunt-contrib-jasmine as well now, with one problem: I need to duplicate the entire requirejs configuration in Gruntfile.js. If I do not do that all tests fail badly.
Is there a way to run tests in a (non-headless) local browser, instead of PhantomJS, like the old grunt-jasmine-runner did? I used connect with a host URL, but that does not do the same thing (it just tells PhantomJS to connect to the server instead of use the local file). Failing that, perhaps a task which just generates the _SpecRunner.html so we can test in the browser ourselves?
I'm wondering if there's a way we might get additional spec runner templates listed in the grunt-contrib-jasmine docs? I've created a template runner for specs which use StealJS for dependency management.
I need someone to help update this plugin to work with grunt 0.4.0rc5.
I had to revert the whole file src-dest mappings implicit iteration abstraction per gruntjs/grunt#606, and once again, multi tasks have to iterate over this.files
manually. In addition, there's a new this.filesSrc
array that contains a reduced, uniqued set of all matched src
files in case the task is read-only and only cares about source files.
See:
this.filesSrc
array.this.files
array.Notes:
nonull
in addition to src
to tell grunt to keep patterns or filepaths that don't actually match files. Because of this, the task shouldn't explode if a nonexistent src
filepath is encountered. I handle this in the grunt-contrib-concat by warning if not grunt.file.exists
but not failing the task.Guidelines for updating / publishing this plugin:
"*"
)README.md
file via grunt.node_modules
, run npm cache clean
and re-run npm install
to test.--tag=master
(not latest
)We're running into the same issue as described in jasmine-contrib/grunt-jasmine-runner#20
Running $ grunt jasmine
, we get:
Running "jasmine:all" (jasmine) task
Testing jasmine specs via phantom
>> TypeError: 'undefined' is not an object (evaluating '$('#sub-head')[0].offsetTop') at
[snip snip]
...............
15 specs in 0.15s.
>> 0 failures
Done, without errors.
The execution has the error code 0, so external tools (e.g. Travis) don't see than an error has occurred.
I think it would be really cool if there was someway to expose the phantom API so my tests could manipulate the page in some fashion.
Hi,
The jasmine plugin is complaining about PhantomJS although phantom is installed :
$ npm install grunt-contrib-jasmine --save-dev
$ npm install grunt-lib-phantomjs
$ grunt jasmine
Running "jasmine:pivotal" (jasmine) task
Testing jasmine specs via phantom
Running PhantomJS...ERROR
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install
>> has failed. Please submit an issue providing as much detail as possible at:
>> https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.
$ ls -1 node_modules/
grunt
[...]
grunt-contrib-jasmine
[...]
grunt-lib-phantomjs
[...]
$ phantomjs --version
1.9.0
Hello, I'm trying to test touch events.
I'm having a ton of trouble trying to initialize touch events. Is this not possible? If so, why not and what should I do?
Is there a way to have the headless WebKit be like an iPhone?
I'm wondering how I can use a fixture on a Spec, for testing a HTML result in a test.
I apologize if this is already available, but I can't seem to run a test on a single it
block.
We have some tests where actual or expected values are Backbone objects, and calling stringify
(PhantomReporter.js on these objects freezes the browser tab for 10-60 seconds because they're very deep.
It might be smart to limit the recursion depth of stringify
.
npm install grunt-contrib-jasmine gives the following error
TypeError: undefined is not a function
at Until.PullStream._flush (C:\Users\Webdev\Inetpub\gym\node_modules\grunt-contrib\node_modules\grunt-contrib-jasmine\node_modules\grunt-lib-phantomjs\node_
modules\phantomjs\node_modules\unzip\node_modules\pullstream\pullstream.js:112:5)
at Until.<anonymous> (_stream_transform.js:131:12)
at Until.g (events.js:175:14)
at Until.EventEmitter.emit (events.js:117:20)
at finishMaybe (_stream_writable.js:332:12)
at endWritable (_stream_writable.js:339:3)
at Until.Writable.end (_stream_writable.js:326:5)
at C:\Users\Webdev\Inetpub\gym\node_modules\grunt-contrib\node_modules\grunt-contrib-jasmine\node_modules\grunt-lib-phantomjs\node_modules\phantomjs\node_mo
dules\unzip\lib\parse.js:282:25
var base = "C:\Users\QE1\Workspace\patsy"
What happens:
[ '../sfl-client/js/test/jasmine/test.js' ]
[ 'C:/Users/QE1/Workspace/sfl-client/js/test/jasmine/test.js' ]
[ '../sfl-client/js/dist/sfl-client.core.js' ]
[ 'C:/Users/QE1/Workspace/sfl-client/js/dist/sfl-client.core.js' ]
Expected result: (not sure about this, but getRelativeFileList should defo not return absolute paths)
[ '../sfl-client/js/test/jasmine/test.js' ]
[ /js/test/jasmine/test.js' ]
[ '../sfl-client/js/dist/sfl-client.core.js' ]
[ /js/dist/sfl-client.core.js' ]
This seem to happen when the base path is different from the path resolved from the spec/src. Any ideas on how this can be fixed or bypassed?
Example config:
options: {
specs: 'test/spec/**/*.js',
template: 'test/specRunner.tmpl',
}
If there are no spec files in "test/spec", then the "specs" variable in the template context will be ['./test/spec/*/.js'] which makes no sense.
This happens because of "getRelativeFileList()" in lib/jasmine.js uses the {nonull: true} option with grunt.file.expand.
I've tried this a few times and have had no luck. I'm on Windows 7 using Node v0.8.14 and npm v1.1.65.
In my project directory, I ran this:
npm install grunt-contrib-jasmine --save-dev
The files downloaded successfully into my node_modules
directory.
I've added the appropriate line into grunt.js
to load the plugin, but when I try to run grunt, I get this:
Loading "jasmine.js" tasks and helpers...ERROR
>> Error: Cannot find module 'grunt'
When I run grunt --help
, the jasmine
task doesn't show up.
Need to account for remote-hosted sources in src/spec/vendor/helper
Hi all,
I've started setting up grunt
for running my tests from the
command line but I've come across the following error message:
$ grunt jasmine
Loading "jasmine.js" tasks...ERROR
>> TypeError: Object #<Object> has no method 'expandFiles'
Warning: Task "jasmine" not found. Use --force to continue.
Aborted due to warnings.
I've included this in the Gruntfile.js
:
grunt.loadNpmTasks('grunt-contrib-jasmine');
so I guess it should find the jasmine task. I'm new to grunt
so
I'm probably missing something. I'd appreciate any help.
I'm running grunt v0.4.0rc5
.
I'm trying to install it with command
$ sudo npm install grunt-contrib-jasmine --save-dev
And during the installation of grunt-lib-phantomjs npm fails with the following error log:
> [email protected] install /mnt/storage/work/rosnano/trunk/labs/1.Quantachrome/gas-analyzer-lab/node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs
> node install.js
Download already available at /home/whatup/tmp/phantomjs/phantomjs-1.9.0-linux-i686.tar.bz2
Extracting tar contents (via spawned process)
Phantom installation failed undefined
npm ERR! [email protected] install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.0-21-generic
npm ERR! command "/usr/bin/node" "/usr/local/bin/npm" "install" "grunt-contrib-jasmine" "--save-dev"
npm ERR! cwd /mnt/storage/work/rosnano/trunk/labs/1.Quantachrome/gas-analyzer-lab
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/storage/work/rosnano/trunk/labs/1.Quantachrome/gas-analyzer-lab/npm-debug.log
npm ERR! not ok code 0
I've already seen some threads about this, which say that the issue's fixed by now, and tried to clear npm's cache and reisntall. It didn't help.
☁ main [develop] ⚡ grunt jasmine
Running "jasmine:test" (jasmine) task
Testing jasmine specs via phantom
Running PhantomJS...ERROR
In order for this task to work properly, PhantomJS must be installed locally
via NPM. If you're seeing this message, generally that means the NPM install
has failed. Please submit an issue providing as much detail as possible at:
https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.
I'm getting this error with latest versions of grunt-contrib-jasmine, even rc5, rc7, cause binPath is invalid. But I also tried to fix it, it still doesnt work. Please tell when i can use this official contrib plugin?
After upgrade from grunt 0.3 with Jasmine Runner to grunt 0.4 with grunt-contrib-jasmine the tests run significantly slower.
I have about 400 tests and the time to run was 2-4 seconds. Now they take 37-55 seconds.
This seems to be an issue only when running in the console using PhantomJS.
When I run them in Chrome using the generated _SpecRunner.html everything seems to be fine and the whole suite takes 1-2 sec.
Anyone else has this problem ?
With this configuration:
jasmine: {
models: {
src: 'src/**/*.js',
options: {
specs: 'spec/unit/models/*Spec.js',
helpers: 'spec/unit/*Helper.js',
vendor: ['lib/underscore.js', 'lib/jquery.js', 'lib/backbone.js'],
host: "http://localhost:9001/"
}
},
}
And then this task:
grunt.registerTask('test_models', ['connect', 'jshint', 'jasmine:models']);
When I run:
$ grunt test_models
I get this output:
Running "connect:server" (connect) task
Starting connect web server on localhost:9001.
Running "jshint:gruntfile" (jshint) task
>> 1 file lint free.
Running "jshint:lib_test" (jshint) task
>> 19 files lint free.
Running "jasmine:models" (jasmine) task
Warning: Arguments to path.join must be strings Use --force to continue.
I don't think I'm missing anything obvious.
I'm curious, since grunt-jasmine-runner supported junit xml output for use in a continuous integration server, are there plans for the same in grunt-contrib-jasmine?
I've just started to experience this problem:
All specs passes just fine, but the teardown function in the jasmine-task fails with the following error message:
Fatal error: ENOTEMPTY, directory not empty 'C:\[...]\.grunt\grunt-contrib-jasmine
As you can see by that path, this is on a Windows machine (win7 64-bit, running node 0.8 64-bit).
The error occurs in the cleanTemp() function in tasks/lib/jasmine.js:
exports.cleanTemp = function() {
rimraf.sync(tempDir);
};
The problem seems to be the sync delete operation (tested with grunt.file.delete, which also fails btw). Converting it to a standard async operation (which rimraf encourages to use) solves the problem.
So I'm proposing to convert the teardown function to be async.
Note: I can't reproduce this bug with a simple, trivial example application, and I can't supply the sources of the project I'm working on (required confidentiality).
I'm using yepnope
to inject Javascript into my pages, and I want to use grunt-contrib-jasmine
to test the loaded modules. However, while the task currently builds the _SpecRunner.html file (which executes the tests correctly when loaded in the browser), the task hangs with PhantomJS never exiting. I suspect it has to do with the onLoadFinished
callback and the way yepnope
dynamically injects resources into the DOM.
Is grunt.event
deprecated? When running the jasmine
task it's throwing a <FATAL> Cannot read property 'emit' of undefined </FATAL>
.
The offending lines are here: https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine.js#L141-144
Simply removing them appears to fix the problem — but I'm unsure of what the original intention was in having those events be emitted.
I have a bunch of jasmine specs that run in jasmine-1.2.0
. Does grunt-contrib-jasmine
work with a particular version of jasmine (particularly 1.2 vs 1.3)?
Thanks for this task - I am using it along with grunt 0.4.0a and require 2.1.1 and the requirejs template.
If I include Lo-Dash (1.0.0-rc.3) as a vendor file then I get an error:
Running "jasmine:genoma" (jasmine) task
Testing jasmine specs via phantom
>> Error: Mismatched anonymous define() module: function () {
>> return lodash;
>> }
>> http://requirejs.org/docs/errors.html#mismatch at
>> src/javascript/libs/require-2.1.1.js:1746
>> src/javascript/libs/require-2.1.1.js:518 onError
>> src/javascript/libs/require-2.1.1.js:1179 intakeDefines
>> src/javascript/libs/require-2.1.1.js:1353 localRequire
>> src/javascript/libs/require-2.1.1.js:1672
>> _SpecRunner.html:54
This is down to the following code in lodash:
// define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module
define(function() {
return lodash;
});
I'm not sure if there is anything that can be done about this? I'm temporarily commenting out the offending code in lo-dash but I wonder if naming the define blocks in the template might prevent this type of error from happening?
It outputs the following:
Testing jasmine specs via phantom
should exist:failed
4 specs, 1 failure in 0.003s.
>> 1 failures
What would be more helpful would be:
Testing jasmine specs via phantom
myFunc should exist:failed | expected undefined to be "function"
4 specs, 1 failure in 0.003s.
>> 1 failures
I don't think you should be limited to setting the baseUrl:
https://github.com/gruntjs/grunt-contrib-jasmine/blob/master/tasks/jasmine/templates/RequireJSRunner.tmpl#L8-10
It would be nice to eschew having to write my own template to support this style:
https://github.com/tkellen/charter/blob/master/test/runner.html#L10-16
I have some integration tests which rely on the absolute positioning of DOM elements via CSS. Currently, there is no option to add custom style sheets in the default templates, only the jasmine styles are added. It would be awesome if the default template would also take custom styles into account.
Whenever I run grunt jasmine
I get the following output:
Running "jasmine:src" (jasmine) task
Testing jasmine specs via phantom
Fatal error: spawn ENOENT
This is my Gruntfile
:
module.exports = function(grunt) {
grunt.initConfig({
jasmine: {
src: 'uptodate.js',
specs: 'test/spec/*.js'
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('default', 'jasmine');
}
Using grunt-contrib-jasmine
v0.5.1
and grunt
v0.4.1
I get the following error on running grunt:
Running "jasmine:src" (jasmine) task
Testing jasmine specs via phantom
..>> TypeError: 'undefined' is not an object (evaluating 'this.views.suites') at
>> .grunt/grunt-contrib-jasmine/jasmine-html.js:45
>> .grunt/grunt-contrib-jasmine/jasmine-html.js:439
..
To reproduce the error i created a simple example project:
https://www.dropbox.com/s/pdznpcbd9y37naj/jasmineIssue.zip
i build it with:
npm install
grunt
Jasmine 1.3.0 use a reserved word ("for") as object property which causes a parse/syntax error in old browsers. (I encountered the parse error on Safari 4.x, and Mobile Safari 4.x)
The jasmine version should be upgraded to 1.3.1 to fix the issue
I have:
node v0.8.9
npm 1.1.61
grunt-cli v0.1.6
grunt v0.4.1
phantomjs 1.9.0
Mac OS 10.8.1
I execute the following from a terminal:
node_modules/grunt-cli/bin/grunt -v -d 1
And I (partially) get:
Testing jasmine specs via phantom
[D] ["/Users/xxxxx/htdocs/eConnect/poc/com.xxxxxxx.poc/knockout/node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/phantomjs/main.js","/var/folders/zp/tj_1pvw52ylc8mc8fsqv65tw0000gn/T/1370273246790.809","_SpecRunner.html","{\"version\":\"1.3.1\",\"timeout\":10000,\"styles\":[],\"specs\":[],\"helpers\":[],\"vendor\":[],\"outfile\":\"_SpecRunner.html\",\"host\":\"\",\"template\":\"/Users/xxxxxx/htdocs/xxxxxx/poc/com.xxxxx.poc/knockout/node_modules/grunt-contrib-jasmine/tasks/jasmine/templates/DefaultRunner.tmpl\",\"templateOptions\":{},\"phantomjs\":{},\"junit\":{}}"]
[D] ["phantomjs","private","version",{"major":1,"minor":9,"patch":0}]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxx/htdocs/xxxxx/poc/com.xxxxx.poc/knockout/_SpecRunner.html"]
[D] ["phantomjs","onUrlChanged","file:///Users/xxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/_SpecRunner.html"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine.css"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine.js"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine-html.js"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/tests/phonenumbers/phoneModelTest.html"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/reporter.js"]
[D] ["phantomjs","onResourceRequested","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine-helper.js"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/_SpecRunner.html"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine.css"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine.js"]
[D] ["phantomjs","onInitialized"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine-html.js"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/tests/phonenumbers/phoneModelTest.html"]
[D] ["phantomjs","error.onError","SyntaxError: Parse error",[]]
>> SyntaxError: Parse error
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/reporter.js"]
[D] ["phantomjs","onResourceReceived","file:///Users/xxxxxx/htdocs/eConnect/poc/com.xxxxxx.poc/knockout/.grunt/grunt-contrib-jasmine/jasmine-helper.js"]
[D] ["phantomjs","jasmine.reportRunnerStarting",[]]
Starting...
[D] ["phantomjs","jasmine.reportRunnerResults",{}]
Runner finished
0 specs in 0s.
[D] ["phantomjs","jasmine.reportJUnitResults",{"suites":[],"consolidatedSuites":{}}]
[D] ["phantomjs","jasmine.done.PhantomReporter"]
>> 0 failures
In particular, I am interested in:
["phantomjs","error.onError","SyntaxError: Parse error",[]]
>> SyntaxError: Parse error
And, also the fact that it should be running at least 1 spec, but appears not to be when it reports 0 specs in 0s.
I also ran against the sample SpecRunner.html and I get the same results.
It'd be nice if the RequireJS template automatically added cs! in front of tests with a .coffee extension. Thoughts?
Hi,
I really want to utilise two different jasmine templates, is that possible and if so, how?
I'm currently using the RequireJS template like so...
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: './app/',
mainConfigFile: './app/main.js'
}
}
/*
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/coverage.json',
report: 'reports/coverage'
}
*/
...but as you can see I've commented out the istanbul code coverage template because I'm not sure how to run it?
I've tried the following (which didn't work)...
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: './app/',
mainConfigFile: './app/main.js'
},
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: './reports/coverage.json',
report: './reports/coverage'
}
}
...and I've also tried setting them up as separate 'tasks' but because I wasn't using the RequireJS template the code coverage template failed really quickly because it couldn't find some global vars set by RequireJS.
Any ideas?
Thanks!
I'm having a problem where PhantomJS is timing out on every run of the jasmine task using the requirejs template. I've tried several config tweaks, figuring that there was some issue with my require paths. I've removed pretty much anything that I think could be causing the breakage, and it's still timing out. My minimal config is here: https://gist.github.com/4055029
Possibly related: this all felt like deja vu to me. I tracked down this thread that I participated in months ago. jasmine-contrib/grunt-jasmine-task#4. Note that the solution that worked for me there doesn't apply here, and it appears that that issue never officially got resolved.
It would be nice to specify some different output formats like Html or Xml or at least a more verbose console output. The auto-generated-deleted _SpecRunner.html
even contains the default complete report but gets thrown away because of the auto-deletion.
Running locally works great… when I push my project to travis ci, I'm seeing some crazy output from phantomjs.
Not sure if this is a bug, or how I can report better than the stack trace at this point.
https://travis-ci.org/benschwarz/cache.js/builds/8655959
Any thoughts?
Looks like this was broken moving over to 0.5.x as it seems to work in 0.4.x
.idea
need to be added to the file .npmignore
Hi there,
it doesn't seem to exist the 'jasmine-server' task (existing in 'grunt-jasmine-runner' ), any reasons for that?
I use live-reload to develop an application.
I would like grunt-contrib-jasmine to place its generated spec runner html file in the live-reload folder so that developers can visit it in the browser. The problem is that the pathing is all based on being in grunt root. Is there a way to change this?
here's my config:
jasmine:
runSpecs:
options:
specs: "<%= yeoman.dev %>/**/*.spec.js"
outfile: "<%= yeoman.dev %>/_autoSpec.html"
template: require('grunt-template-jasmine-requirejs')
#appDir: "<%= yeoman.dev %>" #This is the option I'm looking for
Is it possible to move the location of the generated spec runner without breaking url references? I'm aware of require's base path setting, but this would impact normal application dependencies.
Whenever there is a basic syntax error in one of my Jasmine files, this is all I see:
Obviously knowing there is a syntax error is great, but it would be useful to have some form of clue about what it is. This is somewhat negated by running JSHint over my spec files first, but it would be nice for this to be handled in the plugin.
The syntax error that caused the above error was a missing });
at the bottom of a file.
Is there a way to get detailed error information in case a spec fails? I'd like to see the expected value and the actual value of a failing spec.
Using grunt's template syntax to resolve portions of a host which are not set when the config is processed results in the host being resolved with empty values. When that happens Phantom won't start.
More specifically, when the host is configured to get the hostname and port from connect (http://<% connect.test.options.host %>:<% connect.test.options.port %>/
) and connect is configured to generate the host and port dynamically with ?
and *
, the host will not resolve properly even though connect sets the values in the config: http://:/
.
My recommendation is to add runtimeHost and runtimePort options, which look up the specified value and resolve the host properly. The code is trivial, and implemented here: https://github.com/dustinboston/grunt-contrib-jasmine/compare/gruntjs:master...master. Unforntunately, I didn't create a new branch, so I need to do that.
Just wanted to gauge the interest in implementing this kind of functionality before I moved it to a branch and submitted a pull request. Thanks!
module.exports = function(grunt)
{
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.initConfig({
jasmine: {
pivotal: {
src: 'src/**/*.js',
options: {
specs: 'spec/*Spec.js',
}
}
}
})
}
$ grunt jasmine
Loading "jasmine.js" tasks and helpers...ERROR
>> TypeError: Cannot call method '_' of undefined
<WARN> Task "jasmine" not found. Use --force to continue. </WARN>
Aborted due to warnings.
node : v0.8.14
jasmine-node : 1.0.28
I would love to have test coverage data produced by the testrunner. This should be doable by using jscoverage. I ran into this change for a ruby jasmine gem which might be helpful.
Assume the www-root is nested a few folders deep from the Gruntfile (say foo/bar/web-root relative to the Gruntfile).
When running "grunt jasmine" the _SpecRunner.html file is created next to the Gruntfile and as a result cannot be found by the web-server as it is outside the www-root folder.
If the outfile is specified to be "foo/bar/web-root/_SpecRunner.html" then it is created in the right place, but the file parameter passed to Phantom causes an HTTP "GET /foo/bar/web-root/_SpecRunner.html", instead of a "GET /_SpecRunner.html".
Am I missing some way of doing this, or should there be a way to specify the the "web-root" folder and thus be able to determine and use different paths for writing the SpecRunner file and constructing the URL for the GET request?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.