1
1
mirror of https://github.com/theoludwig/html-w3c-validator.git synced 2025-05-21 23:21:29 +02:00

refactor: usage of node:test instead of tap

This commit is contained in:
2023-07-02 12:18:21 +02:00
parent 3d24ffe971
commit 67806866ee
3 changed files with 14 additions and 19 deletions

View File

@ -1,21 +1,23 @@
import tap from 'tap'
import test from 'node:test'
import assert from 'node:assert/strict'
import { execa } from 'execa'
import { cli } from '../cli.js'
import { HTMLValidatorCommand } from '../HTMLValidatorCommand.js'
await tap.test('html-w3c-validator', async (t) => {
await t.test('should be instance of the command', async (t) => {
await test('html-w3c-validator', async (t) => {
await t.test('should be instance of the command', async () => {
const command = cli.process([])
t.equal(command instanceof HTMLValidatorCommand, true)
assert(command instanceof HTMLValidatorCommand)
})
await t.test('succeeds and validate the html correctly', async (t) => {
await t.test('succeeds and validate the html correctly', async () => {
const exampleURL = new URL('../../example', import.meta.url)
process.chdir(exampleURL.pathname)
await execa('rimraf', ['node_modules'])
await execa('npm', ['install'])
const { exitCode } = await execa('npm', ['run', 'test:html-w3c-validator'])
t.equal(exitCode, 0)
assert.strictEqual(exitCode, 0)
})
})