1
1
mirror of https://github.com/theoludwig/html-w3c-validator.git synced 2024-12-08 00:45:37 +01:00
html-w3c-validator/src/__test__/HTMLValidatorCommand.test.ts

22 lines
743 B
TypeScript
Raw Normal View History

import tap from 'tap'
import { execa } from 'execa'
2022-01-06 22:34:58 +01:00
2022-01-06 19:52:25 +01:00
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) => {
2022-01-06 19:52:25 +01:00
const command = cli.process([])
t.equal(command instanceof HTMLValidatorCommand, true)
2022-01-06 19:52:25 +01:00
})
await t.test('succeeds and validate the html correctly', async (t) => {
const exampleURL = new URL('../../example', import.meta.url)
process.chdir(exampleURL.pathname)
2022-01-06 22:34:58 +01:00
await execa('rimraf', ['node_modules'])
await execa('npm', ['install'])
const { exitCode } = await execa('npm', ['run', 'test:html-w3c-validator'])
t.equal(exitCode, 0)
2022-01-06 19:52:25 +01:00
})
})