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:
29
src/utils/__test__/isExistingPath.test.ts
Normal file
29
src/utils/__test__/isExistingPath.test.ts
Normal 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()
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user