diff --git a/lib/recorder.js b/lib/recorder.js index 273df99..4164265 100644 --- a/lib/recorder.js +++ b/lib/recorder.js @@ -1,7 +1,6 @@ 'use strict' const fs = require('fs') -const mkdirp = require('mkdirp').sync const nock = require('nock') const path = require('path') @@ -150,7 +149,7 @@ class NockRecorder { nock.activate() // this will only run when the root test is being torn down, which means everything // else is finished and now we just need to actually write the snapshot file - mkdirp(path.dirname(this.#snapshotFile)) + fs.mkdirSync(path.dirname(this.#snapshotFile), { recursive: true }) fs.writeFileSync(this.#snapshotFile, JSON.stringify(this.#snapshot, null, 2)) } } diff --git a/package.json b/package.json index 98ee4f9..948524a 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,9 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.11.3", "minipass-fetch": "^3.0.0", - "rimraf": "^3.0.2", "tap": "^16.0.1" }, "dependencies": { - "mkdirp": "^1.0.4", "nock": "^13.2.4" }, "files": [ diff --git a/test/snapshot.js b/test/snapshot.js index c09a982..6ed85a9 100644 --- a/test/snapshot.js +++ b/test/snapshot.js @@ -4,7 +4,6 @@ const fs = require('fs') const http = require('http') const fetch = require('minipass-fetch') const path = require('path') -const rimraf = require('rimraf').sync const patchTap = require('../') const t = patchTap(require('tap')) const Test = t.Test @@ -15,7 +14,7 @@ const server = http.createServer((req, res) => { }) const flushSnapshots = () => { - rimraf(path.resolve(__dirname, '../tap-snapshots')) + fs.rmSync(path.resolve(__dirname, '../tap-snapshots'), { force: true, recursive: true }) } t.afterEach(flushSnapshots)