mirror of
https://github.com/theoludwig/html-w3c-validator.git
synced 2025-05-21 23:21:29 +02:00
refactor: usage of node:test instead of tap
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
import fsMock from 'mock-fs'
|
||||
import tap from 'tap'
|
||||
|
||||
import { isExistingPath } from '../isExistingPath.js'
|
||||
|
||||
await tap.test('utils/isExistingPath', async (t) => {
|
||||
await test('utils/isExistingPath', async (t) => {
|
||||
t.afterEach(() => {
|
||||
fsMock.restore()
|
||||
})
|
||||
@ -12,13 +14,13 @@ await tap.test('utils/isExistingPath', async (t) => {
|
||||
fsMock({
|
||||
'/file.txt': ''
|
||||
})
|
||||
t.equal(await isExistingPath('/file.txt'), true)
|
||||
assert.strictEqual(await isExistingPath('/file.txt'), true)
|
||||
})
|
||||
|
||||
await t.test("should return false if the file doesn't exists", async () => {
|
||||
fsMock({
|
||||
'/file.txt': ''
|
||||
})
|
||||
t.equal(await isExistingPath('/randomfile.txt'), false)
|
||||
assert.strictEqual(await isExistingPath('/randomfile.txt'), false)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user