Skip to content

Commit bec04fc

Browse files
committed
improve tests
1 parent 0643c49 commit bec04fc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • packages/prettyhtml/test

packages/prettyhtml/test/cli.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ const outputFile = path.join(__dirname, 'fixtures', 'default', 'output.html')
88
const inputData = readFileSync(inputFile)
99
const cliPath = path.join(__dirname, '..', 'cli', 'index.js')
1010

11-
test.afterEach.always(t => {
12-
writeFileSync(inputFile, inputData)
13-
})
14-
1511
test('Should format with default settings', t => {
1612
writeFileSync(
1713
inputFile,
@@ -23,3 +19,7 @@ test('Should format with default settings', t => {
2319
t.is(result.status, 0)
2420
t.is(readFileSync(inputFile, 'utf8'), readFileSync(outputFile, 'utf8'))
2521
})
22+
23+
test.after.always('restore file', t => {
24+
writeFileSync(inputFile, inputData)
25+
})

0 commit comments

Comments
 (0)