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
1
vote
1 answer

qunit tests run with grunts grunt-contrib-qunit fails outside of default test folder

The only place I can get qunit tests to run is if the html and js file lives inside the grunt-contrib-qunit\test folder following this information at https://github.com/gruntjs/grunt-contrib-qunit Anything outside of that test folder, like having a…
jsteinmann
  • 4,502
  • 3
  • 17
  • 21
1
vote
2 answers

PhantomJS, Qunit, Grunt testing browser resize widgets

I've created a jQuery UI Widget that resizes a DIV/thing to fill up the browser screen. It all works fine but now I want to create unit tests for testing that it's resizing and keeping to boundaries etc. I'm using Grunt with grunt-contrib-qunit,…
creamcheese
  • 2,524
  • 3
  • 29
  • 55
1
vote
0 answers

Proxy configuration for PhantomJS through grunt (qunit)

I'm attempting to run integration tests via grunt-contrib-qunit. I've set the --proxy flag via the options object, every ajax request returns a 404 (not found) error. Gruntfile.js grunt.loadNpmTasks('grunt-contrib-qunit'); ... grunt.initConfig({ …
Courtney Christensen
  • 9,165
  • 5
  • 47
  • 56
0
votes
1 answer

Execute OPA5 test headless and code coverage

I am aware of using karma and phantomjs to run opa5 headless. I want to know if there any other options? Currently I am using grunt to run qunit and Nightwatch for unit and end-to-end tests. I added OPA5 tests and looking for ways to run it…
user557657
  • 856
  • 1
  • 12
  • 35
0
votes
1 answer

grunt-contrib-qunit plugin is looking for qunit.js file along with my tests.html

I tried loading qunit js from both tests.html and through require, but irrespective of how I load qunit, when I run grunt task to run qunit tests it is failing tests with timeout and in the error it states qunit.js is not found in the same folder…
Sudhakar V
  • 46
  • 5
0
votes
1 answer

grunt error message

Have installed grunt, and set it up. It runs when I type grunt. But am getting the below error. Also find my code below. Running "qunit:files" (qunit) task Warning: 0/0 assertions ran (0ms) Use --force to continue. Aborted due to…
Pepper
  • 709
  • 1
  • 7
  • 15
0
votes
1 answer

Qunit events with Grunt and alternatives

I'm using grunt-contrib-qunit and I'm trying to find event, which event arguments hold information for a failed test (the error message of the failed assert). As far as I see, this is not possible. In the testDone event, the count of the failed…
Lipata
  • 296
  • 1
  • 10
0
votes
1 answer

Grunt Qunit-Tests - Only if assertions fail: PhantomJS timed out, possibly due to a missing QUnit start() call

I am using Grunt to run Qunit tests for a SAPUI5 application. Here is my Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks("grunt-contrib-qunit"); grunt.initConfig({ qunit: { all: ["OpaMatchers.html"] } …
SDD64
  • 706
  • 13
  • 28
0
votes
1 answer

Grunt Qunit exclude file(s)

I have configured the qunit task like this: //For testing qunit: { all: ['Test/**/*.html'] }, Is it possible if I want to exclude one (or two) particular html file?. I want to do something like this: //For testing qunit: { all:…
Ragnarsson
  • 1,715
  • 7
  • 41
  • 74
0
votes
1 answer

grunt not running Qunit tests correctly

Situation : I am currently using QUnit to test a project in TypeScript/Javascript and everything works fine when I'm running them in a browser. Problem : I'm trying to use grunt to run the QUnit tests in a headless mode (I need it for continuous…
Kewin Dousse
  • 3,880
  • 2
  • 25
  • 46
0
votes
1 answer

How do I run QUnit tests with Grunt through a local server instead of the file system?

I'm building a small JS object that manages cookies, basic set, get, and remove functions. I've written tests with QUnit that pass in a browser if I'm running against a local server. I'm booting up a server like so: python -m SimpleHTTPServer…
Avand Amiri
  • 767
  • 7
  • 13
0
votes
2 answers

Mocking 'this' in javascript qunit

if i have a Javascript function that uses, something like this...$(this)[0].element.id; updateElement(){ $(this)[0].element.id; } I am using Qunit, is there a way i can mock 'this' I would like to be able to test this function.
WingMan20-10
  • 3,594
  • 9
  • 31
  • 42
0
votes
1 answer

Qunit test property exists in object

I am using Qunit testing engine in JavaScript and I need to check if a property exists in an object. Here is my setup: var tests = [ { foo: 'foo', bar: 'bar', expected: {} }, { foo: '', bar: '', …
Justin
  • 42,716
  • 77
  • 201
  • 296
1
2