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

feat: add html-w3c-validator command

This commit is contained in:
Divlo
2022-01-06 22:34:58 +01:00
parent 39b05c66a7
commit 77cefcd53f
18 changed files with 34634 additions and 449 deletions

View File

@ -1,3 +1,7 @@
import path from 'node:path'
import execa from 'execa'
import { cli } from '../cli.js'
import { HTMLValidatorCommand } from '../HTMLValidatorCommand.js'
@ -12,11 +16,11 @@ describe('html-w3c-validator', () => {
})
it('succeeds and validate the html correctly', async () => {
console.log = jest.fn()
const exitCode = await cli.run([], {
stdin: process.stdin
})
expect(console.log).toHaveBeenCalledWith('html-w3c-validator')
const examplePath = path.join(__dirname, '..', '..', 'example')
process.chdir(examplePath)
await execa('rimraf', ['node_modules'])
await execa('npm', ['install'])
const { exitCode } = await execa('npm', ['run', 'test:html-w3c-validator'])
expect(exitCode).toEqual(0)
})
})

1
src/__test__/setup.ts Normal file
View File

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