Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add config file support; switch to yargs #3556

Merged
merged 2 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ overrides:
- karma.conf.js
- .wallaby.js
- bin/*
- lib/cli/**/*.js
- test/node-unit/**/*.js
parserOptions:
ecmaVersion: 6
env:
browser: no
- files:
- test/**/*.js
- test/**/*.{js,mjs}
env:
mocha: yes
globals:
Expand All @@ -37,4 +39,9 @@ overrides:
- doc/**/*.js
env:
node: no
- files:
- test/**/*.mjs
parserOptions:
ecmaVersion: 6
sourceType: module

7 changes: 7 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require: test/setup
ui: bdd
global:
- okGlobalA,okGlobalB
- okGlobalC
- callback*
timeout: 200
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
env: null
before_install: true
install: npm install --production
# `--opts /dev/null` means "ignore test/mocha.opts"
script: ./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.spec.js

script: ./bin/mocha --no-config --reporter spec test/sanity/sanity.spec.js
cache:
directories:
- ~/.npm
Expand Down
25 changes: 17 additions & 8 deletions .wallaby.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
module.exports = () => {
return {
files: [
'index.js', 'lib/**/*.js', 'test/setup.js', 'test/assertions.js',
'index.js',
'lib/**/*.{js,json}',
'test/setup.js',
'test/assertions.js',
{
pattern: 'test/node-unit/**/*.fixture.js',
instrument: false
}, {
},
{
pattern: 'test/unit/**/*.fixture.js',
instrument: false
}
},
'package.json',
'test/opts/mocha.opts',
'mocharc.yml'
],
filesWithNoCoverageCalculated: ['test/**/*.fixture.js'],
tests: [
'test/unit/**/*.spec.js', 'test/node-unit/**/*.spec.js'
filesWithNoCoverageCalculated: [
'test/**/*.fixture.js',
'test/setup.js',
'test/assertions.js'
],
tests: ['test/unit/**/*.spec.js', 'test/node-unit/**/*.spec.js'],
env: {
type: 'node',
runner: 'node'
},
workers: {recycle: true},
testFramework: {type: 'mocha', path: __dirname},
setup (wallaby) {
setup(wallaby) {
// running mocha instance is not the same as mocha under test,
// running mocha is the project's source code mocha, mocha under test is instrumented version of the source code
const runningMocha = wallaby.testFramework;
Expand All @@ -33,7 +42,7 @@ module.exports = () => {
// to make test/node-unit/color.spec.js pass, we need to run mocha in the project's folder context
const childProcess = require('child_process');
const execFile = childProcess.execFile;
childProcess.execFile = function () {
childProcess.execFile = function() {
let opts = arguments[2];
if (typeof opts === 'function') {
opts = {};
Expand Down
Loading