Questions tagged [grunt-contrib-qunit]

grunt-contrib-qunit is a Grunt task that enables running QUnit unit tests in a headless PhantomJS instance.

grunt-contrib-qunit is a Grunt task that enables running QUnit unit tests in a headless PhantomJS instance.

28 questions
23
votes
5 answers

Continue certain tasks in grunt even if one fails

Is there a way to configure a sequence of tasks so that specific subsequent ones (I don't want --force on the whole batch) run even if one fails? For example, consider a case like this Create some temporary files Run some unit tests which involve…
Larson S
  • 311
  • 2
  • 7
10
votes
3 answers

How to setup grunt task for requirejs and qunit

I am trying to setup a QUnit environment using requirejs and grunt-contrib-qunit. Here is what I have. gruntfile: qunit: { all: { options: { urls: [ 'http://localhost:8000/qunit/qunit-test-suite.html' ] } …
Markus
  • 2,214
  • 3
  • 19
  • 32
9
votes
2 answers

Setting PhantomJS viewportSize in QUnit test

I need to test my script at different viewport sizes. In my tests I'd like to change the viewport size of PhantomJS by setting page.viewportSize. I'm running my tests through grunt-contrib-qunit and PhantomJS isn't accessible in my test code. Is…
7
votes
4 answers

How to debug Gruntfile.js with log statements?

In my Gruntfile, how can I add log statements, to its processing, as in the following example? karma: { unit: { configFile: "<%= grunt.option('Debug') ? 'build/karma.conf.js' : '' %>", console.log(configFile), …
Gururaj
  • 1,115
  • 2
  • 14
  • 17
5
votes
1 answer

Grunt qunit is failing

I have configured my qunit task is grunt as below: // Unit Test Configuration qunit: { ac: { files: ['test/**/*.html'] } } grunt.registerTask('ac', ['jshint:ac', 'qunit:ac']); jsHint is running fine. But…
VKS
  • 279
  • 4
  • 16
4
votes
1 answer

grunt, qunit, nodejs backend testing

How I can test nodejs backend code using qunit & grunt. In Gruntfile.js how to specify only the js files, So in qunit repo, the sample Gruntfile.js tells about creating html files and there speI am able to see example of html files which can be…
u_peerless
  • 644
  • 2
  • 9
  • 23
4
votes
1 answer

How to place if else block in gruntfile.js

Code: karma: { unit: { if ("<%= grunt.option('Release') %>" ) { //do nothing } else { configFile: 'build/karma.conf.js', singleRun: true, browsers: ['PhantomJS'] …
Gururaj
  • 1,115
  • 2
  • 14
  • 17
3
votes
1 answer

QUnit and PhantomJS testing of AJAX requests only works through proxy

I'm attempting to use grunt-contrib-qunit to run a pre-existing suite of qunit tests (testing parsing of ajax request results) in headless mode with Phantom on Windows 8. The tests complete fine in these scenarios: When the remote page is accessed…
GotDibbs
  • 3,068
  • 1
  • 23
  • 29
2
votes
1 answer

Fatal error: spawn ENOENT

Gruntfile.js content: grunt.initConfig({ connect: { server: { options: { port: 5005, base: '.' } } }, qunit: { all:…
Ashwin Hegde
  • 1,733
  • 4
  • 19
  • 49
2
votes
1 answer

Cannot find module 'grunt-lib-phantomjs' in 'grunt-contrib-qunit'

I have installed phantomjs 1.9.7 wgetting the zip and then moving it to PATH in ubuntu virtualbox. On nodejs project, firing npm install -no-bin-links goes fine, but grunt test fails with following error,…
prayagupa
  • 30,204
  • 14
  • 155
  • 192
2
votes
1 answer

grunt qunit in conjunction with grunt server

While running grunt server for developing, How can I separately use the grunt qunit task to run the tests. While trying to pass ["test/**/*.html"] to the all property, but that fails to run and returns (Warning: 0/0 assertions ran (0ms) Use) It…
adardesign
  • 33,973
  • 15
  • 62
  • 84
1
vote
1 answer

How do i automatically test an openui5 app with qunit and phantomjs? (Error: found in negative cache)

We have an OpenUI5 app with QUnit tests. We tried to automate the tests with grunt-contrib-qunit, but when grunt-contrib-qunit starts our qunittests.html file in phantomjs, it gives the following error: >> Error: found in negative cache:…
DerZyklop
  • 3,672
  • 2
  • 19
  • 27
1
vote
1 answer

How to use 'csv-parse' in browser?

I'm trying to run the csv-parse. And it fails with Uncaught Error: Module name "stream" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded require.js:166 makeError require.js:166 localRequire…
Artyom
  • 3,507
  • 2
  • 34
  • 67
1
vote
0 answers

Is there a way to make the qunit grunt task run tests in parallel?

The qunit plugin works great, but I've got so many tests (some of which are a little slow) that it takes 14 seconds to run all of them. I think this time could be cut in half if my tests could be run in parallel. As an attempt, I tried creating…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
1
vote
1 answer

QUnit fails with grunt, passes in the browser

In the script I'm developing, I check to see if a variable is instanceof HTMLAudioElement. When I run QUnit via a grunt task, it fails with >> Message: Died on test #1 at file:///path/test/lib/qunit.js:425 >> at file:///path/test/all.js:24:…
Andrew
  • 4,145
  • 2
  • 37
  • 42
1
2