Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/utils/timers.js')
-rw-r--r--test/lib/utils/timers.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lib/utils/timers.js b/test/lib/utils/timers.js
index 259ecd5dd..eee7aea14 100644
--- a/test/lib/utils/timers.js
+++ b/test/lib/utils/timers.js
@@ -68,11 +68,11 @@ t.test('finish unstarted timer', async (t) => {
})
t.test('writes file', async (t) => {
- const { timers } = mockTimers(t, { id: 'TIMING_FILE' })
+ const { timers } = mockTimers(t)
const dir = t.testdir()
process.emit('time', 'foo')
process.emit('timeEnd', 'foo')
- timers.load({ dir })
+ timers.load({ path: (f) => resolve(dir, `TIMING_FILE-${f}`) })
timers.writeFile({ some: 'data' })
const data = JSON.parse(fs.readFileSync(resolve(dir, 'TIMING_FILE-timing.json')))
t.match(data, {
@@ -88,7 +88,7 @@ t.test('fails to write file', async (t) => {
const { logs, timers } = mockTimers(t)
const dir = t.testdir()
- timers.load({ dir: join(dir, 'does', 'not', 'exist') })
+ timers.load({ path: () => join(dir, 'does', 'not', 'exist') })
timers.writeFile()
t.match(logs.warn, [['timing', 'could not write timing file']])