Socket
Socket
Sign inDemoInstall

grunt-contrib-qunit

Package Overview
Dependencies
Maintainers
10
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-qunit - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

chrome/bridge.js

@@ -27,3 +27,3 @@ /*

// These methods connect QUnit to PhantomJS.
// These methods connect QUnit to Headless Chrome.
QUnit.log(function(obj) {

@@ -30,0 +30,0 @@ // What is this I don’t even

{
"name": "grunt-contrib-qunit",
"description": "Run QUnit unit tests in a headless Chrome instance",
"version": "3.0.0",
"version": "3.0.1",
"author": {

@@ -19,5 +19,5 @@ "name": "Grunt Team",

"dependencies": {
"bluebird": "^3.5.1",
"eventemitter2": "^5.0.1",
"puppeteer": "1.3.x"
"p-each-series": "^1.0.0",
"puppeteer": "1.7.0"
},

@@ -24,0 +24,0 @@ "devDependencies": {

@@ -1,2 +0,2 @@

# grunt-contrib-qunit v3.0.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-qunit.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-qunit) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/3vd43779joyj6qji/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-qunit/branch/master)
# grunt-contrib-qunit v3.0.1 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-qunit.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-qunit) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/3vd43779joyj6qji/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-qunit/branch/master)

@@ -270,2 +270,3 @@ > Run QUnit unit tests in a headless Chrome instance

* 2018-08-12   v3.0.1   Fixed regressions.
* 2018-07-24   v3.0.0   Switch to using headless chrome / puppeteer instead of phantomjs

@@ -297,2 +298,2 @@ * 2017-04-04   v2.0.0   Remove usage of `QUnit.jsDump` Upgrade qunitjs to 2.3.0 (#123) adding an Introduction to the README (#140)

*This file was generated on Tue Jul 24 2018 17:47:21.*
*This file was generated on Sun Aug 12 2018 23:44:39.*

@@ -15,7 +15,9 @@ /*

var url = require('url');
var EventEmitter2 = require('eventemitter2');
var EventEmitter = require('eventemitter2');
// NPM libs.
var Promise = require('bluebird');
var pEachSeries = require('p-each-series');
var puppeteer = require('puppeteer');
var Promise = global.Promise;
// Shared functions

@@ -104,8 +106,8 @@

function getFullUrl(url) {
if ((url.length < 4) || (url.substring(0,4) !== 'http')) {
return 'file://' + path.resolve(__dirname, '..', url);
} else {
function getPath(url) {
if (url.substr( 0, 7 ) === 'http://' || url.substr( 0, 8 ) === 'https://') {
return url;
}
return 'file://' + path.resolve(process.cwd(), url);
}

@@ -115,3 +117,3 @@

var eventBus = new EventEmitter2({wildcard: true, maxListeners: 0});
var eventBus = new EventEmitter({wildcard: true, maxListeners: 0});

@@ -121,3 +123,2 @@ // Keep track of the last-started module and test. Additionally, keep track

var options;
var puppeteerLaunchOptions;
var currentModule;

@@ -169,3 +170,2 @@ var currentTest;

// QUnit hooks.

@@ -233,3 +233,2 @@ eventBus.on('qunit.begin', function() {

eventBus.on('qunit.done', function(failed, passed, total, runtime) {
currentStatus.runtime += runtime;

@@ -252,4 +251,2 @@ currentStatus.assertions.passed += passed;

// Re-broadcast qunit events on grunt.event.

@@ -300,3 +297,3 @@ eventBus.on('qunit.*', function() {

});
puppeteerLaunchOptions = options.puppeteer || {};
var puppeteerLaunchOptions = Object.assign({headless: true}, options.puppeteer);

@@ -306,8 +303,13 @@ // This task is asynchronous.

var urls;
var bridgeFile = fs.readFileSync(options.inject, 'utf8');
if (!bridgeFile) {
grunt.fail.fatal('Could not load the specified Chrome/QUnit bridge file.');
done(false);
return;
// Read the content of the specified bridge files
var bridgeFiles = Array.isArray(options.inject) ? options.inject : [options.inject];
var bridgContents = [];
for (var i = 0; i < bridgeFiles.length; i++) {
try {
bridgContents.push(fs.readFileSync(bridgeFiles[i], 'utf8'));
} catch (err) {
grunt.fail.fatal('Could not load the specified Chrome/QUnit bridge file: ' + bridgeFiles[i]);
}
}

@@ -370,5 +372,3 @@

// Instantiate headless browser
puppeteer.launch(Object.assign({
headless: true,
}, puppeteerLaunchOptions))
puppeteer.launch(puppeteerLaunchOptions)
.then(function(b) {

@@ -398,3 +398,3 @@ browser = b;

var color = colors[args[i].type()];
grunt.log.writeln(color ? txt[color] : txt);
grunt.log.writeln(color ? txt[color] : txt);
}

@@ -416,5 +416,5 @@ });

// injected before any other DOMContentLoaded or window.load event handler.
page.evaluateOnNewDocument('if (window.QUnit) {\n' + bridgeFile + '\n} else {\n' + 'document.addEventListener("DOMContentLoaded", function() {\n' + bridgeFile + '\n});\n}\n');
page.evaluateOnNewDocument('if (window.QUnit) {\n' + bridgContents.join(";") + '\n} else {\n' + 'document.addEventListener("DOMContentLoaded", function() {\n' + bridgContents.join(";") + '\n});\n}\n');
return Promise.mapSeries(urls, function(url) {
return pEachSeries(urls, function(url) {
// Reset current module.

@@ -428,15 +428,8 @@ currentModule = null;

new Promise(function(resolve, reject) {
eventBus.once('qunit.done', function() {
setTimeout(resolve, 1);
});
eventBus.once('fail.*', function() {
setTimeout(function() {
reject(url);
}, 1);
});
eventBus.once('qunit.done', function() { resolve(); });
eventBus.once('fail.*', function() { reject(url); });
}),
// Navigate to the url to be tested
page.goto(getFullUrl(url), {
timeout: options.timeout
})
page.goto(getPath(url), { timeout: options.timeout })
]);

@@ -443,0 +436,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc