Skip to content

Commit

Permalink
Use separate config file for renderer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Dec 4, 2020
1 parent 1b2c857 commit 15f9509
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .mocharc.renderer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"renderer": true,
"color": true,
"window-config-file": "test/support/window.config.json",
"script": [
"test/support/preload.js"
],
"url": "test/support/index.html"
}
6 changes: 0 additions & 6 deletions .mocharc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.main = (argv = process.argv.slice(2)) => {
.fail((msg, err, yargs) => {
yargs.showHelp()
console.error(`\n${symbols.error} ${ansi.red('ERROR:')} ${msg}`)
console.error(err.stack)
if (err) console.error(err.stack)
app.exit(1)
})
.help('help', 'Show usage information and exit')
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
"pretest": "standard",
"test": "npm run test:main && npm run test:renderer",
"test:main": "node bin/electron-mocha test/main",
"test:renderer": "node bin/electron-mocha --renderer --script test/support/preload.js --url test/support/index.html test/renderer",
"test:renderer": "node bin/electron-mocha --config .mocharc.renderer.json test/renderer",
"mocha": "node bin/electron-mocha",
"prepublishOnly": "npm test"
},
"mocha": {
"color": true,
"require-main": [
"test/support/requireMain"
],
"require": [
"test/support/require"
]
},
"bin": {
"electron-mocha": "./bin/electron-mocha"
},
Expand Down

0 comments on commit 15f9509

Please sign in to comment.