1
+ const { normalize } = require ( 'path' )
1
2
const t = require ( 'tap' )
2
3
3
4
const fs = require ( '../' )
4
5
5
6
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 ( ) )
7
9
const rootStat = await fs . lstat ( root )
8
10
let tempDir
9
11
await fs . withTempDir ( root , async ( dir ) => {
@@ -19,7 +21,8 @@ t.test('creates a temp directory and passes it to provided function', async (t)
19
21
} )
20
22
21
23
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 ( ) )
23
26
const rootStat = await fs . lstat ( root )
24
27
let tempDir
25
28
const result = await fs . withTempDir ( root , async ( dir ) => {
@@ -37,7 +40,8 @@ t.test('result from provided function bubbles out', async (t) => {
37
40
} )
38
41
39
42
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 ( ) )
41
45
const rootStat = await fs . lstat ( root )
42
46
let tempDir
43
47
await t . rejects ( fs . withTempDir ( root , async ( dir ) => {
0 commit comments