mirror of
https://github.com/appium/appium.git
synced 2026-02-25 04:39:56 -06:00
- add `jsconfig.json` for the TS language server to understand the project - update `.wallaby.js` to transpile fixtures if necessary; run on save to reduce lag - update single-file Mocha debug launch config - add `test` env in `babel.config.json` which is used by the former - add some handy vscode tasks - add a bunch of types - remove unused `babel-eslint` (we use `@babel/eslint-parser`) - bump `ecmaVersion` in `eslint-config-appium` - remove cruft from babel configs (`shippedProposals: true` goes a long way) - enable `sinon-chai` globally in tests - add `rewiremock` for module-level mocking (sinon cannot do this itself, but they work in tandem)
26 lines
1010 B
JavaScript
26 lines
1010 B
JavaScript
'use strict';
|
|
/**
|
|
* Mocha will load this file to configure the environment to use Chai as the
|
|
* assertion library. Since Chai is a singleton, we can run into problems when
|
|
* running files individually, if we have not carefully configured Chai in every
|
|
* single test file. This file means less boilerplate and less random test
|
|
* failures when running single test files.
|
|
*
|
|
* For simplicity, this file is _not_ transpiled. If it were, Mocha would need
|
|
* to load different versions of this file depending on the test context (are we
|
|
* running tests against the distfiles, or the source files?).
|
|
*
|
|
* @module
|
|
*/
|
|
|
|
const chai = require('chai');
|
|
const chaiAsPromised = require('chai-as-promised');
|
|
const sinonChai = require('sinon-chai');
|
|
|
|
// The `chai` global is set if a test needs something special.
|
|
// Most tests won't need this.
|
|
global.chai = chai.use(chaiAsPromised).use(sinonChai);
|
|
|
|
// `should()` is only necessary when working with some `null` or `undefined` values.
|
|
global.should = chai.should();
|