diff --git a/package.json b/package.json index 9468e855..a0eeb859 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,7 @@ "jasmine-browser-runner": "github:jasmine/jasmine-browser-runner", "jsdom": "^26.0.0", "prettier": "1.17.1", - "sass": "^1.58.3", - "shelljs": "^0.9.2" + "sass": "^1.58.3" }, "browserslist": [ "Safari >= 15", diff --git a/spec/npmPackage/npmPackageSpec.js b/spec/npmPackage/npmPackageSpec.js index 41d4caf6..86d3f126 100644 --- a/spec/npmPackage/npmPackageSpec.js +++ b/spec/npmPackage/npmPackageSpec.js @@ -1,23 +1,21 @@ const fs = require('node:fs'); const path = require('node:path'); const os = require('node:os'); +const child_process = require('node:child_process'); describe('npm package', function() { beforeAll(function() { - const shell = require('shelljs'), - pack = shell.exec('npm pack', { silent: true }); - - this.tarball = pack.stdout.split('\n')[0]; + const packOutput = child_process.execSync('npm pack', { + encoding: 'utf8', + stdio: ['pipe', 'pipe', 'pipe'] + }); + this.tarball = packOutput.split('\n')[0]; 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, - { - silent: true - } - ); - expect(untar.code).toBe(0); + child_process.execSync(`tar -xzf ${this.tarball} -C ${this.tmpDir}`, { + encoding: 'utf8' + }); this.packagedCore = require(path.join( this.tmpDir, @@ -42,7 +40,7 @@ describe('npm package', function() { afterAll(function() { fs.unlinkSync(this.tarball); - fs.rmSync(this.tmpDir, {recursive: true}); + fs.rmSync(this.tmpDir, { recursive: true }); }); it('has a root path', function() {