Skip to content

Commit

Permalink
ci test spawn wrap 2
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Apr 1, 2024
1 parent c1bf427 commit 693cf50
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion packages/ethernaut-common/src/test/terminal.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/ethernaut-interact-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 693cf50

Please sign in to comment.