-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move test to node test framework #110
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const t = require('node:test') | ||
const assert = require('node:assert') | ||
const test = t.test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit import test on same line
const t = require('node:test') | |
const assert = require('node:assert') | |
const test = t.test | |
const { test } = require('node:test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to this comment: #110 (comment)
Use test context assert ref
Example:
test('Test Name', t => {
t.plan(1) // plan
// stuff
t.assert.strictEqual(value, expectedValue) // asset
})
Example with nested tests:
test('Test Name', async (t) => {
t.plan(2)
await t.test('Test Name', t => {
t.plan(1) // plan
// stuff
t.assert.strictEqual(value, expectedValue) // assert
})
await t.test('Test Name', t => {
t.plan(2) // plan
// stuff
t.assert.strictEqual(value, expectedValue) // assert
t.assert.deepStrictEqual(objValue, expectedObjValue) // assert
})
})
@@ -1,6 +1,7 @@ | |||
'use strict' | |||
|
|||
const t = require('tap') | |||
const t = require('node:test') | |||
const assert = require('node:assert') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove node:assert
in favor of test context assert ref
Signed-off-by: Frazer Smith <[email protected]>
Hi!
I moved the test suite from tap to node test framework.
Checklist
npm run test
and the Code of conduct