Skip to content

Commit

Permalink
fix: add logging for the build-test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 28, 2022
1 parent d2d9e5d commit 991fdc2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
process.env.NODE_ENV = 'test'

var path = require('path')

// find the test command from package.json prebuild.test entry
var test = null

try {
Expand All @@ -15,5 +17,12 @@ try {
// do nothing
}

if (test) require(path.join(process.cwd(), test))
else require('./')()
if (test) {
const testPath = path.join(process.cwd(), test)
console.log(`Running require("${testPath}")`)
require(testPath)
}
else {
console.log(`Running require("./")() at ${process.cwd()}`)
require('./')()
}

0 comments on commit 991fdc2

Please sign in to comment.