diff --git a/package.json b/package.json index a23e4c51..2188cf2e 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,9 @@ "jsdom": "^26.0.0", "load-grunt-tasks": "^5.1.0", "prettier": "1.17.1", + "rimraf": "^5.0.10", "sass": "^1.58.3", - "shelljs": "^0.9.2", - "temp": "^0.9.0" + "shelljs": "^0.9.2" }, "browserslist": [ "Safari >= 15", diff --git a/spec/npmPackage/npmPackageSpec.js b/spec/npmPackage/npmPackageSpec.js index 4cc67722..94f2f74a 100644 --- a/spec/npmPackage/npmPackageSpec.js +++ b/spec/npmPackage/npmPackageSpec.js @@ -1,14 +1,16 @@ -describe('npm package', function() { - const path = require('path'), - temp = require('temp').track(), - fs = require('fs'); +const fs = require('node:fs'); +const path = require('node:path'); +const os = require('node:os'); +const { rimrafSync } = require('rimraf'); +describe('npm package', function() { beforeAll(function() { const shell = require('shelljs'), pack = shell.exec('npm pack', { silent: true }); this.tarball = pack.stdout.split('\n')[0]; - this.tmpDir = temp.mkdirSync(); // automatically deleted on exit + const prefix = path.join(os.tmpdir(), 'jasmine-npm-package'); + this.tmpDir = fs.mkdtempSync(prefix); const untar = shell.exec( 'tar -xzf ' + this.tarball + ' -C ' + this.tmpDir, @@ -41,6 +43,7 @@ describe('npm package', function() { afterAll(function() { fs.unlinkSync(this.tarball); + rimrafSync(this.tmpDir); }); it('has a root path', function() {