Comparing version 0.5.3 to 0.5.5
@@ -1,2 +0,2 @@ | ||
var QUnit = require('qunit/qunit/qunit'), | ||
var QUnit = require('../support/qunit/qunit'), | ||
path = require('path'), | ||
@@ -6,2 +6,8 @@ _ = require('underscore'), | ||
// cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle, | ||
// which make it possible to encode cyclical structures and dags in JSON, and to | ||
// then recover them. JSONPath is used to represent the links. | ||
// http://GOESSNER.net/articles/JsonPath/ | ||
require('../support/json/cycle'); | ||
var options = JSON.parse(process.argv[2]), | ||
@@ -21,11 +27,14 @@ currentModule = path.basename(options.code.path, '.js'), | ||
*/ | ||
function load(res) { | ||
var requirePath = res.path.replace(/\.js$/, ''); | ||
function _require(res, addToGlobal) { | ||
var exports = require(res.path.replace(/\.js$/, '')); | ||
// test resource can define'namespace'to expose its exports as a named object | ||
if (res.namespace) { | ||
global[res.namespace] = require(requirePath); | ||
} else { | ||
_.extend(global, require(requirePath)); | ||
if (addToGlobal) { | ||
// resource can define 'namespace' to expose its exports as a named object | ||
if (res.namespace) { | ||
global[res.namespace] = exports; | ||
} else { | ||
_.extend(global, exports); | ||
} | ||
} | ||
QUnit.start(); | ||
@@ -62,3 +71,3 @@ } | ||
event: 'assertionDone', | ||
data: data | ||
data: JSON.decycle(data) | ||
}); | ||
@@ -74,3 +83,2 @@ }); | ||
data.module = data.module || currentModule; | ||
process.send({ | ||
@@ -111,8 +119,10 @@ event: 'testDone', | ||
// require deps | ||
options.deps.forEach(load); | ||
options.deps.forEach(_require, true); | ||
// require code | ||
load(options.code); | ||
_require(options.code, true); | ||
// require tests | ||
options.tests.forEach(load); | ||
options.tests.forEach(function(res) { | ||
_require(res, false); | ||
}); |
{ | ||
"name": "qunit", | ||
"description": "QUnit testing framework for nodejs", | ||
"version": "0.5.3", | ||
"version": "0.5.5", | ||
"author": "Oleg Slobodskoi <oleg008@gmail.com>", | ||
@@ -24,7 +24,7 @@ "contributors": [ | ||
"cli-table": "0.0.2", | ||
"tracejs": "0.1.4", | ||
"qunit": "https://github.com/jquery/qunit/tarball/v1.8.0" | ||
"tracejs": "0.1.4" | ||
}, | ||
"devDependencies": { | ||
"chainer": "0.0.5" | ||
"chainer": "0.0.5", | ||
"timekeeper": "0.0.2" | ||
}, | ||
@@ -31,0 +31,0 @@ "optionalDependencies": { |
@@ -9,2 +9,2 @@ exports.myMethod = function() { | ||
}, 100); | ||
} | ||
}; |
@@ -8,3 +8,5 @@ test('myMethod test', function() { | ||
ok(true, 'myAsyncMethod started'); | ||
stop(); | ||
expect(3); | ||
@@ -16,2 +18,14 @@ myAsyncMethod(function(data) { | ||
}); | ||
}) | ||
}) | ||
test('circular reference', function() { | ||
equal(global, global, 'test global'); | ||
}); | ||
test('use original Date', function() { | ||
var timekeeper = require('timekeeper'); | ||
timekeeper.travel(Date.now() - 1000000); | ||
ok(true, 'date modified'); | ||
}); |
@@ -15,3 +15,3 @@ var a = require('assert'), | ||
// log expected and actual values for failed tests | ||
//errors: true, | ||
// errors: true, | ||
// log tests overview | ||
@@ -40,7 +40,9 @@ // tests: true, | ||
files: 1, | ||
tests: 2, | ||
assertions: 5, | ||
tests: 4, | ||
assertions: 7, | ||
failed: 2, | ||
passed: 3 | ||
passed: 5 | ||
}; | ||
a.ok(res.runtime > 0, 'Date was modified'); | ||
delete res.runtime; | ||
@@ -47,0 +49,0 @@ a.deepEqual(stat, res, 'base testrunner test'); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
94656
5
21
2425
0
6
2