diff --git a/packages/ethernaut-common/src/test/terminal.js b/packages/ethernaut-common/src/test/terminal.js index 127e5d60..de6392d4 100644 --- a/packages/ethernaut-common/src/test/terminal.js +++ b/packages/ethernaut-common/src/test/terminal.js @@ -1,5 +1,6 @@ const pty = require('node-pty') const os = require('os') +const path = require('path') const debug = require('ethernaut-common/src/ui/debug') const assert = require('assert') const chalk = require('chalk') @@ -51,7 +52,19 @@ class Terminal { this.running = true debug.log(`Running command: ${command}`, 'terminal') - this._write(`${command} && sleep 1 && exit\r`) + const p = path.resolve( + __dirname, + '../../../../', + 'node_modules/nyc/bin/wrap.js', + ) + const h = path.resolve( + __dirname, + '../../../../', + 'node_modules/.bin/hardhat', + ) + const c = command.replace('npx hardhat', `node ${p} ${h}`) + console.log(c) + this._write(`${c} && sleep 1 && exit\r`) const completion = this._waitForCompletion() const waitPromise = wait(delay) diff --git a/packages/ethernaut-interact-ui/package.json b/packages/ethernaut-interact-ui/package.json index 1245533d..2b0d6b74 100644 --- a/packages/ethernaut-interact-ui/package.json +++ b/packages/ethernaut-interact-ui/package.json @@ -7,7 +7,7 @@ "build": "npm run install:test", "compile": "echo 'No compile step'", "install:test": "cd test/fixture-projects/basic-project && npm install", - "test": "nyc --all --reporter text --reporter nyc-report-lcov-absolute mocha --exit --timeout 60000 --require 'test/setup.js' --recursive '../../**/*.test.js' --ignore '../../fixture-projects/**/*'" + "test": "nyc --all --use-spawn-wrap --reporter text --reporter nyc-report-lcov-absolute mocha --exit --timeout 60000 --require 'test/setup.js' --recursive '../../**/*.test.js' --ignore '../../fixture-projects/**/*'" }, "author": "theethernaut", "license": "ISC",