From 275e06947a2f7b2548cf00bae2ef4a201bd825d7 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 19 May 2022 11:35:41 +0200 Subject: [PATCH 01/18] Pkg: Fix .repository --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8bdf8d7..803fe7a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.0.0", "description": "Node 18's node:test, as a node module", "license": "MIT", - "repository": "juliangruber/node-core-test", + "repository": "nodejs/node-core-test", "main": "./index.js", "types": "./index.d.ts", "bin": { From 743204b5f73ea584b8f5754f598275042eca0ed8 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:05:59 +0200 Subject: [PATCH 02/18] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 803fe7a..a998c24 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "node-core-test", + "name": "test", "version": "2.0.0", "description": "Node 18's node:test, as a node module", "license": "MIT", @@ -8,7 +8,7 @@ "types": "./index.d.ts", "bin": { "node--test": "./bin/node--test.js", - "node-core-test": "./bin/node-core-test.js" + "node": "./bin/node-core-test.js" }, "imports": { "#internal/*": "./lib/internal/*.js", From ff8ef81849610588a3451392c1db847d0eef8ba4 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:06:13 +0200 Subject: [PATCH 03/18] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a998c24..582793f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "types": "./index.d.ts", "bin": { "node--test": "./bin/node--test.js", - "node": "./bin/node-core-test.js" + "test": "./bin/node-core-test.js" }, "imports": { "#internal/*": "./lib/internal/*.js", From 92ef534922cc319ef6a31b6d47a410fe4ad26ba3 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:07:54 +0200 Subject: [PATCH 04/18] Rename node-core-test.js to test.js --- bin/{node-core-test.js => test.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin/{node-core-test.js => test.js} (100%) diff --git a/bin/node-core-test.js b/bin/test.js similarity index 100% rename from bin/node-core-test.js rename to bin/test.js From 104cbc707fb96190380c9a269929ba0f252ecae2 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:08:13 +0200 Subject: [PATCH 05/18] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 582793f..e5e6c86 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "types": "./index.d.ts", "bin": { "node--test": "./bin/node--test.js", - "test": "./bin/node-core-test.js" + "test": "./bin/test.js" }, "imports": { "#internal/*": "./lib/internal/*.js", From 6f0dbec2a6e8a44b3cad5f4c2f768662a9eaef77 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:08:40 +0200 Subject: [PATCH 06/18] Update package.json Co-authored-by: Antoine du Hamel --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5e6c86..71ad869 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "test", "version": "2.0.0", - "description": "Node 18's node:test, as a node module", + "description": "Node 18's node:test, as a npm package", "license": "MIT", "repository": "nodejs/node-core-test", "main": "./index.js", From 08a9b589cb683318d0f0e68fb52202148d65504d Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Fri, 20 May 2022 14:13:57 +0200 Subject: [PATCH 07/18] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 826a483..885ceef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# node-core-test +# test -[![CI](https://github.com/juliangruber/node-core-test/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/node-core-test/actions/workflows/ci.yml) +[![CI](https://github.com/nodejs/test/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/test/actions/workflows/ci.yml) This is a user-land port of [`node:test`](https://github.com/nodejs/node/blob/adaf60240559ffb58636130950262ee3237b7a41/doc/api/test.md), the experimental test runner introduced in Node.js 18. This module makes it @@ -31,11 +31,11 @@ The `node:test` module facilitates the creation of JavaScript tests that report results in [TAP][] format. To access it: ```mjs -import test from 'node-core-test' +import test from 'test' ``` ```cjs -const test = require('node-core-test') +const test = require('test') ``` Tests created via the `test` module consist of a single function that is @@ -160,14 +160,14 @@ test('skip() method with message', t => { ### `only` tests -If `node-core-test` is started with the `--test-only` command-line option, it is +If `test` is started with the `--test-only` command-line option, it is possible to skip all top level tests except for a selected subset by passing the `only` option to the tests that should be run. When a test with the `only` option set is run, all subtests are also run. The test context's `runOnly()` method can be used to implement the same behavior at the subtest level. ```js -// Assume node-core-test is run with the --test-only command-line option. +// Assume test is run with the --test-only command-line option. // The 'only' option is set, so this test is run. test('this test is run', { only: true }, async t => { // Within this test, all subtests are run by default. @@ -234,7 +234,7 @@ test('a test that creates asynchronous activity', t => { The Node.js test runner can be invoked from the command line: ```bash -node-core-test --test +test --test # or use the shortcut version: node--test ``` @@ -249,7 +249,7 @@ Alternatively, one or more paths can be provided as the final argument(s) to the Node.js command, as shown below. ```bash -node-core-test --test test1.js test2.mjs custom_test_dir/ +test --test test1.js test2.mjs custom_test_dir/ node--test test1.js test2.mjs custom_test_dir/ ``` From 24561efc6f247dc69124df03e531a70a37212f51 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 15:43:49 +0200 Subject: [PATCH 08/18] Update package.json Co-authored-by: Antoine du Hamel --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71ad869..50cea6e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "test", "version": "2.0.0", - "description": "Node 18's node:test, as a npm package", + "description": "Node.js 18's node:test, as an npm package", "license": "MIT", "repository": "nodejs/node-core-test", "main": "./index.js", From 375aee03c74de4f4c9410dbb8ee623f510dd5f3b Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 15:44:35 +0200 Subject: [PATCH 09/18] Update package.json Co-authored-by: Antoine du Hamel --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50cea6e..032fc4e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "types": "./index.d.ts", "bin": { "node--test": "./bin/node--test.js", - "test": "./bin/test.js" + "test": "./bin/node-core-test.js" }, "imports": { "#internal/*": "./lib/internal/*.js", From a84b89532e62e38316b0f917c51ca19449ccc30f Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 15:46:02 +0200 Subject: [PATCH 10/18] Update README.md Co-authored-by: Antoine du Hamel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 885ceef..329adf1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/nodejs/test/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/test/actions/workflows/ci.yml) -This is a user-land port of [`node:test`](https://github.com/nodejs/node/blob/adaf60240559ffb58636130950262ee3237b7a41/doc/api/test.md), +This is a user-land port of [`node:test`](https://nodejs.org/api/test.html), the experimental test runner introduced in Node.js 18. This module makes it available in Node.js 14 and later. From 05aedf3d61b720502aff6db50ebd4ac57e9807e8 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 15:46:11 +0200 Subject: [PATCH 11/18] Update README.md Co-authored-by: Antoine du Hamel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 329adf1..b126168 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# test +# The `test` npm package [![CI](https://github.com/nodejs/test/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/test/actions/workflows/ci.yml) From d357e8f57cd32a8a60bbbddf3460dbac172b8794 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 15:52:15 +0200 Subject: [PATCH 12/18] fix tests --- bin/{test.js => node-core-test.js} | 0 package-lock.json | 7 ++++--- test/common/index.js | 2 +- test/message.js | 2 +- test/node-core-test.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) rename bin/{test.js => node-core-test.js} (100%) diff --git a/bin/test.js b/bin/node-core-test.js similarity index 100% rename from bin/test.js rename to bin/node-core-test.js diff --git a/package-lock.json b/package-lock.json index 75c264a..83ad507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "node-core-test", + "name": "test", "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "node-core-test", + "name": "test", "version": "2.0.0", "license": "MIT", "dependencies": { @@ -13,7 +13,8 @@ "string.prototype.replaceall": "^1.0.6" }, "bin": { - "node-core-test": "bin/test_runner.js" + "node--test": "bin/node--test.js", + "test": "bin/node-core-test.js" }, "devDependencies": { "standard": "^17.0.0", diff --git a/test/common/index.js b/test/common/index.js index 9f898be..584d345 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -6,7 +6,7 @@ const noop = () => {} const { bin } = require('../../package.json') -process.execPath = path.resolve(__dirname, '..', '..', bin['node-core-test']) +process.execPath = path.resolve(__dirname, '..', '..', bin.test) const mustCallChecks = [] diff --git a/test/message.js b/test/message.js index 9eff062..c4c7efe 100644 --- a/test/message.js +++ b/test/message.js @@ -7,7 +7,7 @@ const { exec } = require('node:child_process') const { createInterface } = require('node:readline') const { bin } = require('../package.json') -const binPath = resolve(__dirname, '..', bin['node-core-test']) +const binPath = resolve(__dirname, '..', bin.test) const MESSAGE_FOLDER = join(__dirname, './message/') const WAIT_FOR_ELLIPSIS = Symbol('wait for ellispis') diff --git a/test/node-core-test.js b/test/node-core-test.js index 2891ed1..53a274c 100644 --- a/test/node-core-test.js +++ b/test/node-core-test.js @@ -6,7 +6,7 @@ const test = require('#node:test') const { bin } = require('../package.json') -const binPath = resolve(__dirname, '..', bin['node-core-test']) +const binPath = resolve(__dirname, '..', bin.test) const nodeDashDashTestPath = resolve(__dirname, '..', bin['node--test']) const fixturesDir = join(__dirname, 'fixtures', 'node-core-test') From c848da16c08b308706777a13a8b84fbf4ed5bdbb Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Sun, 22 May 2022 19:55:27 +0200 Subject: [PATCH 13/18] Update README.md Co-authored-by: Antoine du Hamel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b126168..52a9a58 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The `test` npm package -[![CI](https://github.com/nodejs/test/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/test/actions/workflows/ci.yml) +[![CI](https://github.com/nodejs/node-core-test/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/node-core-test/actions/workflows/ci.yml) This is a user-land port of [`node:test`](https://nodejs.org/api/test.html), the experimental test runner introduced in Node.js 18. This module makes it From 14566dd97bde77bd17b6ec9e66268dc74539532a Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 Jun 2022 15:12:34 +0200 Subject: [PATCH 14/18] docs --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 52a9a58..76fcd99 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ test('skip() method with message', t => { ### `only` tests -If `test` is started with the `--test-only` command-line option, it is +If `node--test` is started with the `--test-only` command-line option, it is possible to skip all top level tests except for a selected subset by passing the `only` option to the tests that should be run. When a test with the `only` option set is run, all subtests are also run. The test context's `runOnly()` @@ -234,8 +234,6 @@ test('a test that creates asynchronous activity', t => { The Node.js test runner can be invoked from the command line: ```bash -test --test -# or use the shortcut version: node--test ``` From 7e374f943c2d049b7049d40d472b7d34c53db190 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 Jun 2022 15:13:09 +0200 Subject: [PATCH 15/18] docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76fcd99..db3cf25 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ option set is run, all subtests are also run. The test context's `runOnly()` method can be used to implement the same behavior at the subtest level. ```js -// Assume test is run with the --test-only command-line option. +// Assume node--test is run with the --test-only command-line option. // The 'only' option is set, so this test is run. test('this test is run', { only: true }, async t => { // Within this test, all subtests are run by default. From cf2afc10bd23533961c775cae14221b939900363 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 Jun 2022 15:15:19 +0200 Subject: [PATCH 16/18] Update README.md Co-authored-by: Antoine du Hamel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db3cf25..8eb873f 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ Alternatively, one or more paths can be provided as the final argument(s) to the Node.js command, as shown below. ```bash -test --test test1.js test2.mjs custom_test_dir/ +node--test test1.js test2.mjs custom_test_dir/ node--test test1.js test2.mjs custom_test_dir/ ``` From eec4bac0ca422184a1bb296f00cf61ad137c9bf2 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 Jun 2022 15:18:45 +0200 Subject: [PATCH 17/18] update license --- LICENSE | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/LICENSE b/LICENSE index 455f7a8..f3a7b9a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -util-promisify is licensed for use as follows: +node-core-test is licensed for use as follows: -Copyright 2022 Julian Gruber +Copyright 2022 Node.js contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -8,7 +8,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -This license applies to parts of util-promisify originating from the +This license applies to parts of node-core-test originating from the https://github.com/nodejs/node/ repository: """ @@ -32,27 +32,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ - -This license applies to parts of util-promisify originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" \ No newline at end of file From 723ff924919774c6d9b1f5d0e80a56978e945340 Mon Sep 17 00:00:00 2001 From: Julian Gruber Date: Thu, 2 Jun 2022 15:20:22 +0200 Subject: [PATCH 18/18] update license --- LICENSE | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/LICENSE b/LICENSE index f3a7b9a..33e7963 100644 --- a/LICENSE +++ b/LICENSE @@ -1,16 +1,5 @@ node-core-test is licensed for use as follows: -Copyright 2022 Node.js contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -This license applies to parts of node-core-test originating from the -https://github.com/nodejs/node/ repository: - """ Copyright Node.js contributors. All rights reserved.