-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: converted all the tap tests with node:test #739
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.
Unfortunately not how we would like it.
Lets take from surrogate.test.js the first test case:
'use strict'
const test = require('tap').test
const validator = require('is-my-json-valid')
const build = require('..')
test('render a string with surrogate pairs as JSON:test 1', (t) => {
t.plan(2)
const schema = {
title: 'surrogate',
type: 'string'
}
const validate = validator(schema)
const stringify = build(schema)
const output = stringify('𝌆')
t.equal(output, '"𝌆"')
t.ok(validate(JSON.parse(output)), 'valid schema')
})
You did:
'use strict'
const { describe } = require('node:test')
const { equal, ok } = require('node:assert')
const validator = require('is-my-json-valid')
const build = require('..')
describe('render a string with surrogate pairs as JSON:test 1', (t) => {
const schema = {
title: 'surrogate',
type: 'string'
}
const validate = validator(schema)
const stringify = build(schema)
const output = stringify('𝌆')
equal(output, '"𝌆"')
ok(validate(JSON.parse(output)), 'valid schema')
})
what i expected:
'use strict'
const { test } = require('node:test')
const validator = require('is-my-json-valid')
const build = require('..')
test('render a string with surrogate pairs as JSON:test 1', (t) => {
t.plan(2)
const schema = {
title: 'surrogate',
type: 'string'
}
const validate = validator(schema)
const stringify = build(schema)
const output = stringify('𝌆')
t.assert.strictEqual(output, '"𝌆"')
t.assert.ok(validate(JSON.parse(output)), 'valid schema')
})
Please revert and change accordingly. Thank you for your effort.
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.
Agree with
maaaaany changes 😄 it should be fine now! |
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.
Can somebody another review. I just scrolled down in my phone and just checked if my remark was implemented.
9e8fb31
to
e937674
Compare
tap
tonode:test
andnode:assert
tap
dependency and related configuration filesChecklist
npm run test
andnpm run benchmark
and the Code of conduct