Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qunit

Package Overview
Dependencies
Maintainers
0
Versions
105
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 3.0.0-alpha.3 to 3.0.0-alpha.4

qunit/esm/qunit-wrapper-nodejs-module.js

6

bin/qunit.js

@@ -39,5 +39,5 @@ #!/usr/bin/env node

)
.option('--seed [value]',
'specify a seed to re-order your tests; '
+ 'if specified without a value, a seed will be generated'
.option('--seed <value>',
'specify a seed to enable randomized ordering of tests.\n'
+ 'set to "true" to generate a new seed.'
)

@@ -44,0 +44,0 @@ .option('-w, --watch', 'watch files for changes and re-run the test suite')

@@ -5,3 +5,3 @@ {

"description": "The powerful, easy-to-use testing framework.",
"version": "3.0.0-alpha.3",
"version": "3.0.0-alpha.4",
"homepage": "https://qunitjs.com",

@@ -36,7 +36,21 @@ "author": {

"src/cli/",
"qunit/qunit.js",
"qunit/qunit.css",
"qunit/",
"LICENSE.txt"
],
"main": "qunit/qunit.js",
"exports": {
".": {
"node": {
"import": "./qunit/esm/qunit-wrapper-nodejs-module.js",
"default": "./qunit/qunit.js"
},
"module": {
"import": "./qunit/esm/qunit.module.js",
"default": "./qunit/qunit-wrapper-bundler-require.js"
},
"import": "./qunit/esm/qunit.module.js",
"default": "./qunit/qunit.js"
},
"./qunit/qunit.css": "./qunit/qunit.css"
},
"engines": {

@@ -51,10 +65,10 @@ "node": ">=18"

"devDependencies": {
"@babel/core": "^7.24.6",
"@babel/plugin-external-helpers": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/core": "7.25.2",
"@babel/plugin-external-helpers": "7.25.9",
"@babel/preset-env": "7.25.4",
"@qunitjs/browserstack-runner": "0.9.5-qunitjs.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.7",
"benchmark": "2.1.4",

@@ -74,18 +88,18 @@ "eslint": "^8.57.0",

"fuzzysort": "1.2.1",
"grunt": "^1.6.1",
"grunt-contrib-connect": "^5.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt": "1.6.1",
"grunt-contrib-connect": "5.0.0",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-qunit": "^10.1.1",
"grunt-search": "^0.1.8",
"grunt-search": "0.1.8",
"kleur": "4.1.5",
"npm-reporter": "file:./test/cli/fixtures/npm-reporter",
"nyc": "^17.0.0",
"proxyquire": "^1.8.0",
"requirejs": "^2.3.6",
"rollup": "^4.18.0",
"tap-min": "^3.0.0"
"proxyquire": "2.1.3",
"requirejs": "2.3.7",
"rollup": "4.21.3",
"tap-min": "3.0.0"
},
"scripts": {
"build": "rollup -c && grunt copy:src-css",
"build-coverage": "rollup -c --environment BUILD_TARGET:coverage && grunt copy:src-css",
"build": "rollup -c && grunt copy",
"build-coverage": "rollup -c --environment BUILD_TARGET:coverage && grunt copy",
"build-dev": "node build/dev.js",

@@ -92,0 +106,0 @@ "benchmark": "npm install --silent --no-audit --prefix test/benchmark/ && node test/benchmark/micro.js",

@@ -0,1 +1,3 @@

'use strict';
module.exports = function requireFromCWD (mod) {

@@ -2,0 +4,0 @@ const resolvedPath = require.resolve(mod, { paths: [process.cwd()] });

@@ -1,3 +0,10 @@

// Depending on the exact usage, QUnit could be in one of several places, this
// function handles finding it.
'use strict';
const path = require('path');
const { Module } = require('module');
/**
* Depending on the exact usage, QUnit could be in one of several places, this
* function handles finding it.
*/
module.exports = function requireQUnit (resolve = require.resolve) {

@@ -18,8 +25,26 @@ try {

// current project's dependency.
const localQUnitPath = resolve('qunit', {
//
// NOTE: We can't use require.resolve() because, despite it taking a 'paths'
// option, the resolution algorithm [1] is poisoned by current filename (i.e.
// this src/cli/require-qunit.js file). The documentation doesn't say it,
// but in practice the "paths" option only overrides how step 6 (LOAD_NODE_MODULES)
// traverses directories. It does not influence step 5 (LOAD_PACKAGE_SELF) which
// looks explicilty relative to the current file (regardless of `process.cwd`,
// and regardless of `paths` passed to require.resolve). This wasn't an issue
// until QUnit 3.0 because LOAD_PACKAGE_SELF only looks for cases where
// package.json uses "exports", which QUnit 3.0 adopted for ESM support.
//
// If this uses `requires.resolve(, paths:[cwd])` instead of
// `Module.createRequire(cwd).resolve()`, then this would always return
// the 'qunit' copy that this /src/cli/require-qunit.js file came from,
// regardless of the process.cwd(), which defeats the purpose of looking
// relative to process.cwd().
//
// This is covered by /test/cli/require-qunit-test.js
//
// [1]: https://nodejs.org/docs/latest-v18.x/api/modules.html#all-together
const localQUnitPath = Module.createRequire(
path.join(process.cwd(), 'fake.js')
).resolve('qunit');
// Support: Node 10. Explicitly check "node_modules" to avoid a bug.
// Fixed in Node 12+. See https://github.com/nodejs/node/issues/35367.
paths: [process.cwd() + '/node_modules', process.cwd()]
});
delete require.cache[localQUnitPath];

@@ -42,4 +67,4 @@ return require(localQUnitPath);

//
delete require.cache[resolve('../../qunit/qunit')];
return require('../../qunit/qunit');
delete require.cache[resolve('../../qunit/qunit.js')];
return require('../../qunit/qunit.js');
}

@@ -46,0 +71,0 @@

@@ -46,22 +46,16 @@ 'use strict';

// Replace any previous instance, e.g. in watch mode
QUnit = globalThis.QUnit = requireQUnit();
if (options.filter) {
QUnit.config.filter = options.filter;
globalThis.qunit_config_filter = options.filter;
}
if (options.module) {
QUnit.config.module = options.module;
globalThis.qunit_config_module = options.module;
}
if (options.seed) {
globalThis.qunit_config_seed = options.seed;
}
const seed = options.seed;
if (seed) {
if (seed === true) {
// Length may vary from 6-14, pad to 10
QUnit.config.seed = Math.random().toString(36).slice(2).padEnd(10, '0');
} else {
QUnit.config.seed = seed;
}
// Replace any previous instance, e.g. in watch mode
QUnit = globalThis.QUnit = requireQUnit();
if (QUnit.config.seed) {
console.log(`Running tests with seed: ${QUnit.config.seed}`);

@@ -68,0 +62,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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