X 归档 2022-04-03
Writing tests for the new Node.js test runner:
import test from 'node:test';
import * as assert from 'assert/strict';
test('synchronous test', (t) => {
assert.equal(1, 1);
});
test('asynchronous test', async (t) => {
assert.equal(1, 1);
});
https://nodejs.org/download/nightly/v18.0.0-nightly20220403561885152e/docs/api/test.html
import test from 'node:test';
import * as assert from 'assert/strict';
test('synchronous test', (t) => {
assert.equal(1, 1);
});
test('asynchronous test', async (t) => {
assert.equal(1, 1);
});
https://nodejs.org/download/nightly/v18.0.0-nightly20220403561885152e/docs/api/test.html
为新的 Node.js test runner 编写测试:
import test from 'node:test';
import * as assert from 'assert/strict';
test('synchronous test', (t) => {
assert.equal(1, 1);
});
test('asynchronous test', async (t) => {
assert.equal(1, 1);
});
https://nodejs.org/download/nightly/v18.0.0-nightly20220403561885152e/docs/api/test.html
import test from 'node:test';
import * as assert from 'assert/strict';
test('synchronous test', (t) => {
assert.equal(1, 1);
});
test('asynchronous test', async (t) => {
assert.equal(1, 1);
});
https://nodejs.org/download/nightly/v18.0.0-nightly20220403561885152e/docs/api/test.html
