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

@ -0,0 +1,29 @@
import fsMock from 'mock-fs'
import { isExistingPath } from '../isExistingPath.js'
describe('utils/isExistingFile', () => {
afterEach(async () => {
fsMock.restore()
})
it('should return true if the file exists', async () => {
fsMock(
{
'/file.txt': ''
},
{ createCwd: false }
)
expect(await isExistingPath('/file.txt')).toBeTruthy()
})
it("should return false if the file doesn't exists", async () => {
fsMock(
{
'/file.txt': ''
},
{ createCwd: false }
)
expect(await isExistingPath('/randomfile.txt')).toBeFalsy()
})
})