Skip to content
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

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

puskin94
Copy link
Contributor

  1. Converted all the tests in the repo from tap to node:test and node:assert
  2. Removed the tap dependency and related configuration files

Checklist

@mcollina mcollina requested review from ivan-tymoshenko, Uzlopak and mcollina and removed request for Uzlopak September 16, 2024 15:30
Copy link
Contributor

@Uzlopak Uzlopak left a 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.

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with

#739 (review)

@puskin94
Copy link
Contributor Author

maaaaany changes 😄 it should be fine now!

Copy link
Contributor

@Uzlopak Uzlopak left a 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.

package.json Outdated Show resolved Hide resolved
@Eomm Eomm merged commit 517a7bf into fastify:master Sep 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants