Skip to content

Commit

Permalink
clean up runner-save-file junk more reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 25, 2017
1 parent 174e99b commit 07f68dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/runner-save-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var okre = new RegExp('test[\\\\/]test[/\\\\]ok\\.js \\.+ 10/10( [0-9\.]+m?s)?$'
var notokre = new RegExp('test[\\\\/]test[/\\\\]not-ok\\.js \\.+ 0/[12]( [0-9\.]+m?s)?$', 'm')
var fs = require('fs')
var which = require('which')
var saveFile = 'runner-save-test-' + process.pid

t.test('save-file', function (t) {
var bailoutOpts = [true, false]
Expand All @@ -22,7 +23,6 @@ t.test('save-file', function (t) {
})

function runTest (bailout, t) {
var saveFile = 'runner-save-test-' + process.pid
var n = 0
function saveFileTest (cb) {
var args = [run, '-s' + saveFile, notok, ok, '-CRclassic']
Expand Down Expand Up @@ -104,3 +104,8 @@ t.test('save-file', function (t) {
t.end()
}
})

t.test('cleanup', function (t) {
try { fs.unlinkSync(saveFile) } catch (er) {}
t.end()
})

0 comments on commit 07f68dd

Please sign in to comment.