New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qunit

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qunit - npm Package Compare versions

Comparing version 0.6.4 to 0.7.0

lib/generators.js

32

lib/child.js

@@ -5,3 +5,5 @@ var QUnit = require('qunitjs'),

trace = require('tracejs').trace,
coverage = require('./coverage');
coverage = require('./coverage'),
generators = require('./generators'),
co = require('co');

@@ -111,2 +113,30 @@ // cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle,

if (generators.support) {
var test = QUnit.test;
/**
* Support generators.
*/
global.test = QUnit.test = function(testName, expected, callback, async) {
var fn;
if ( arguments.length === 2 ) {
callback = expected;
expected = null;
}
if (generators.isGeneratorFn(callback)) {
fn = function() {
stop();
co(callback)();
start();
};
} else {
fn = callback;
}
return test.call(this, testName, expected, fn, async);
};
}
/**

@@ -113,0 +143,0 @@ * Provide better stack traces

92

package.json
{
"name": "qunit",
"description": "QUnit testing framework for nodejs",
"version": "0.6.4",
"author": "Oleg Slobodskoi <oleg008@gmail.com>",
"contributors": [
{"name": "Jonathan Buchanan"},
{"name": "Ashar Voultoiz"},
{"name": "Drew Fyock"}
],
"repository": {
"type": "git",
"url": "http://github.com/kof/node-qunit.git"
"name": "qunit",
"description": "QUnit testing framework for nodejs",
"version": "0.7.0",
"author": "Oleg Slobodskoi <oleg008@gmail.com>",
"contributors": [
{
"name": "Jonathan Buchanan"
},
"keywords": ["TDD", "QUnit", "unit", "testing", "tests", "async"],
"bin": {"qunit": "./bin/cli.js"},
"engines": {"node": ">=0.6.0 < 0.11.0"},
"scripts": {
"test": "node ./test/testrunner.js"
{
"name": "Ashar Voultoiz"
},
"dependencies": {
"underscore": "^1.6.0",
"argsparser": "^0.0.6",
"cli-table": "^0.3.0",
"tracejs": "^0.1.8",
"qunitjs": "1.10.0"
},
"devDependencies": {
"chainer": "^0.0.5",
"timekeeper": "^0.0.4"
},
"optionalDependencies": {
"istanbul": "^0.2.4"
},
"licenses": [
{
"type": "MIT",
"url": "http: //www.opensource.org/licenses/mit-license.php"
}
]
{
"name": "Drew Fyock"
}
],
"repository": {
"type": "git",
"url": "http://github.com/kof/node-qunit.git"
},
"keywords": [
"TDD",
"QUnit",
"unit",
"testing",
"tests",
"async"
],
"bin": {
"qunit": "./bin/cli.js"
},
"engines": {
"node": ">=0.6.0 < 0.12.0"
},
"scripts": {
"test": "node --harmony ./test/testrunner.js"
},
"dependencies": {
"argsparser": "^0.0.6",
"cli-table": "^0.3.0",
"co": "^3.0.6",
"qunitjs": "1.10.0",
"tracejs": "^0.1.8",
"underscore": "^1.6.0"
},
"devDependencies": {
"chainer": "^0.0.5",
"timekeeper": "^0.0.4"
},
"optionalDependencies": {
"istanbul": "https://github.com/gotwarlost/istanbul/tarball/harmony"
},
"licenses": [
{
"type": "MIT",
"url": "http: //www.opensource.org/licenses/mit-license.php"
}
]
}

@@ -18,2 +18,3 @@ ## QUnit testing framework for nodejs.

- you can run the same tests in browser if there is no dependencies to node
- generators support

@@ -180,3 +181,3 @@ ### Installation

test("a basic test example", function (assert) {
test("a basic test example", function () {
ok(true, "this test is fine");

@@ -189,7 +190,7 @@ var value = "hello";

test("first test within module", 1, function (assert) {
test("first test within module", 1, function () {
ok(true, "a dummy");
});
test("second test within module", 2, function (assert) {
test("second test within module", 2, function () {
ok(true, "dummy 1 of 2");

@@ -208,3 +209,3 @@ ok(true, "dummy 2 of 2");

test("some other test", function (assert) {
test("some other test", function () {
expect(2);

@@ -222,7 +223,7 @@ equal(true, false, "failing test");

test("this test is using shared environment", 1, function (assert) {
test("this test is using shared environment", 1, function () {
deepEqual({ test: 123 }, this.options, "passing test");
});
test("this is an async test example", function (assert) {
test("this is an async test example", function () {
expect(2);

@@ -237,3 +238,9 @@ stop();

### Generators support
test("my async test with generators", function* () {
var data = yield asyncFn();
equal(data, {a: 1}, 'generators work');
});
### Run tests

@@ -240,0 +247,0 @@

@@ -6,3 +6,4 @@ var a = require('assert'),

var tr = require('../lib/testrunner'),
log = require('../lib/log');
log = require('../lib/log'),
generators = require('../lib/generators');

@@ -179,2 +180,3 @@ var fixtures = __dirname + '/fixtures',

a.deepEqual(stat, res, 'coverage code testing works');
tr.options.coverage = false;
chain.next();

@@ -184,2 +186,24 @@ });

if (generators.support) {
chain.add('generators', function() {
tr.run({
code: fixtures + '/generators-code.js',
tests: fixtures + '/generators-test.js'
}, function(err, res) {
var stat = {
files: 1,
tests: 1,
assertions: 1,
failed: 0,
passed: 1
};
delete res.runtime;
delete res.coverage;
a.equal(err, null, 'no errors');
a.deepEqual(stat, res, 'coverage code testing works');
chain.next();
});
});
}
chain.add(function() {

@@ -186,0 +210,0 @@ console.log('\nAll tests ok.');

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