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

feat: usage of ESM modules imports (instead of CommonJS)

This commit is contained in:
Divlo
2022-04-06 19:59:31 +02:00
parent e032bbe637
commit e762c0fad5
23 changed files with 9357 additions and 27618 deletions

View File

@ -1,26 +1,21 @@
import path from 'node:path'
import execa from 'execa'
import tap from 'tap'
import { execa } from 'execa'
import { cli } from '../cli.js'
import { HTMLValidatorCommand } from '../HTMLValidatorCommand.js'
describe('html-w3c-validator', () => {
afterEach(() => {
jest.clearAllMocks()
})
it('should be instance of the command', () => {
await tap.test('html-w3c-validator', async (t) => {
await t.test('should be instance of the command', async (t) => {
const command = cli.process([])
expect(command).toBeInstanceOf(HTMLValidatorCommand)
t.equal(command instanceof HTMLValidatorCommand, true)
})
it('succeeds and validate the html correctly', async () => {
const examplePath = path.join(__dirname, '..', '..', 'example')
process.chdir(examplePath)
await t.test('succeeds and validate the html correctly', async (t) => {
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'])
expect(exitCode).toEqual(0)
t.equal(exitCode, 0)
})
})

View File

@ -1 +0,0 @@
jest.setTimeout(60000)