Skip to content

Commit e6fd057

Browse files
committed
fix(tests): fix path assertions in windows
1 parent 9d4e158 commit e6fd057

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/with-temp-dir.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
const { normalize } = require('path')
12
const t = require('tap')
23

34
const fs = require('../')
45

56
t.test('creates a temp directory and passes it to provided function', async (t) => {
6-
const root = t.testdir()
7+
// normalize is necessary until https://github.com/tapjs/libtap/pull/40 is shipped
8+
const root = normalize(t.testdir())
79
const rootStat = await fs.lstat(root)
810
let tempDir
911
await fs.withTempDir(root, async (dir) => {
@@ -19,7 +21,8 @@ t.test('creates a temp directory and passes it to provided function', async (t)
1921
})
2022

2123
t.test('result from provided function bubbles out', async (t) => {
22-
const root = t.testdir()
24+
// normalize is necessary until https://github.com/tapjs/libtap/pull/40 is shipped
25+
const root = normalize(t.testdir())
2326
const rootStat = await fs.lstat(root)
2427
let tempDir
2528
const result = await fs.withTempDir(root, async (dir) => {
@@ -37,7 +40,8 @@ t.test('result from provided function bubbles out', async (t) => {
3740
})
3841

3942
t.test('cleans up when provided function rejects', async (t) => {
40-
const root = t.testdir()
43+
// normalize is necessary until https://github.com/tapjs/libtap/pull/40 is shipped
44+
const root = normalize(t.testdir())
4145
const rootStat = await fs.lstat(root)
4246
let tempDir
4347
await t.rejects(fs.withTempDir(root, async (dir) => {

0 commit comments

Comments
 (0)