qunitx 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.js +54 -0
- package/deno.json +2 -2
- package/deno.lock +0 -3752
- package/package.json +20 -40
- package/{index.js → shims/browser/index.js} +2 -4
- package/shims/{deno.js → deno/index.js} +1 -1
- package/shims/{nodejs.js → node/index.js} +1 -1
- package/vendor/package.json +1 -4
- package/cli.js +0 -25
- package/deno/cli.js +0 -21
- package/lib/boilerplates/default-project-config-values.js +0 -6
- package/lib/boilerplates/setup/tests.hbs +0 -15
- package/lib/boilerplates/setup/tsconfig.json +0 -109
- package/lib/boilerplates/test.js +0 -25
- package/lib/commands/generate.js +0 -33
- package/lib/commands/help.js +0 -38
- package/lib/commands/init.js +0 -70
- package/lib/commands/run/tests-in-browser.js +0 -162
- package/lib/commands/run.js +0 -119
- package/lib/servers/http.js +0 -233
- package/lib/setup/bind-server-to-port.js +0 -14
- package/lib/setup/browser.js +0 -55
- package/lib/setup/config.js +0 -46
- package/lib/setup/file-watcher.js +0 -72
- package/lib/setup/fs-tree.js +0 -48
- package/lib/setup/keyboard-events.js +0 -34
- package/lib/setup/test-file-paths.js +0 -79
- package/lib/setup/web-server.js +0 -241
- package/lib/setup/write-output-static-files.js +0 -22
- package/lib/tap/display-final-result.js +0 -15
- package/lib/tap/display-test-result.js +0 -73
- package/lib/utils/find-internal-assets-from-html.js +0 -16
- package/lib/utils/find-project-root.js +0 -17
- package/lib/utils/indent-string.js +0 -11
- package/lib/utils/listen-to-keyboard-key.js +0 -44
- package/lib/utils/parse-cli-flags.js +0 -57
- package/lib/utils/path-exists.js +0 -11
- package/lib/utils/resolve-port-number-for.js +0 -27
- package/lib/utils/run-user-module.js +0 -18
- package/lib/utils/search-in-parent-directories.js +0 -15
- package/lib/utils/time-counter.js +0 -8
- /package/shims/{deno-assert.js → deno/assert.js} +0 -0
- /package/shims/{nodejs-assert.js → node/assert.js} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default async function resolvePortNumberFor(portNumber) {
|
|
2
|
-
if (await portIsAvailable(portNumber)) {
|
|
3
|
-
return portNumber;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
return (await resolvePortNumberFor(portNumber + 1));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function portIsAvailable(portNumber) {
|
|
10
|
-
return new Promise(async (resolve) => {
|
|
11
|
-
const net = await import('net');
|
|
12
|
-
const server = net.createServer();
|
|
13
|
-
|
|
14
|
-
server.once('error', function(err) {
|
|
15
|
-
if (err.code === 'EADDRINUSE') {
|
|
16
|
-
resolve(false);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
server.once('listening', function() {
|
|
21
|
-
server.close();
|
|
22
|
-
resolve(true);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
server.listen(portNumber);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import kleur from 'kleur';
|
|
2
|
-
|
|
3
|
-
export default async function runUserModule(modulePath, params, scriptPosition) {
|
|
4
|
-
try {
|
|
5
|
-
let func = await import(modulePath);
|
|
6
|
-
if (func) {
|
|
7
|
-
func.default ?
|
|
8
|
-
await func.default(params) :
|
|
9
|
-
typeof func === 'function' ? await func(params) : null;
|
|
10
|
-
}
|
|
11
|
-
} catch (error) {
|
|
12
|
-
console.log('#', kleur.red(`QUnitX ${scriptPosition} script failed:`));
|
|
13
|
-
console.trace(error);
|
|
14
|
-
console.error(error);
|
|
15
|
-
|
|
16
|
-
return process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import pathExists from './path-exists.js';
|
|
2
|
-
|
|
3
|
-
async function searchInParentDirectories(directory, targetEntry) {
|
|
4
|
-
directory = directory === '.' ? process.cwd() : directory;
|
|
5
|
-
|
|
6
|
-
if (await pathExists(`${directory}/${targetEntry}`)) {
|
|
7
|
-
return `${directory}/${targetEntry}`;
|
|
8
|
-
} else if (directory === '') {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return await searchInParentDirectories(directory.slice(0, directory.lastIndexOf('/')), targetEntry);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default searchInParentDirectories;
|
|
File without changes
|
|
File without changes
|