mirror of
https://github.com/appium/appium.git
synced 2026-10-24 17:51:56 +08:00
This PR makes `chai` and `should()` _globals_ when using Mocha: - `chai` is configured with `chai-as-promised` - A `.mocharc.js` requires `./test/setup.js` _from the monorepo root_. - Updated the ESLint config to recognize the globals. - Updated Wallaby config All instances of `import chai...` and the like have been removed from all test files.
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = (wallaby) => {
|
|
return {
|
|
compilers: {
|
|
'**/*.js': wallaby.compilers.babel(),
|
|
},
|
|
debug: true,
|
|
env: {
|
|
type: 'node',
|
|
},
|
|
files: [
|
|
'./packages/**/*.js',
|
|
'./packages/**/*.json',
|
|
'!./packages/**/build/**',
|
|
'!./packages/**/test/**/*-specs.js',
|
|
'!./packages/*/node_modules/**',
|
|
'!./packages/*/gulpfile.js',
|
|
// below this are fixtures
|
|
{
|
|
binary: true,
|
|
pattern: './packages/support/test/assets/sample_binary.plist',
|
|
},
|
|
{
|
|
instrument: false,
|
|
pattern: './packages/support/test/assets/sample_text.plist',
|
|
},
|
|
{
|
|
instrument: false,
|
|
pattern: './packages/*/test/**/fixtures/**/*',
|
|
},
|
|
{
|
|
instrument: false,
|
|
pattern: './packages/base-driver/static/**/*',
|
|
},
|
|
{
|
|
instrument: false,
|
|
pattern: './packages/gulp-plugins/build/**/*',
|
|
},
|
|
{
|
|
instrument: false,
|
|
pattern: './test/setup.js'
|
|
}
|
|
],
|
|
testFramework: 'mocha',
|
|
tests: [
|
|
'./packages/*/test/**/*-specs.js',
|
|
'!./packages/*/test/**/*-e2e-specs.js',
|
|
'!./packages/*/node_modules/**',
|
|
// this is more of an E2E test and it's tedious to run
|
|
'!./packages/gulp-plugins/test/transpile-specs.js',
|
|
],
|
|
workers: {
|
|
restart: true,
|
|
},
|
|
setup() {
|
|
require('./test/setup');
|
|
}
|
|
};
|
|
};
|