mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 01:16:43 +00:00
Tests: Use a mocha file helper to always load config-tests first
Change-type: patch
This commit is contained in:
parent
e7f753007f
commit
53b2b54b23
@ -94,6 +94,7 @@
|
||||
"mocha": {
|
||||
"reporter": "spec",
|
||||
"require": "ts-node/register/transpile-only",
|
||||
"file": "./tests/config-tests",
|
||||
"timeout": 12000,
|
||||
"_": "tests/**/*.spec.ts"
|
||||
},
|
||||
|
@ -15,9 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
require('../config-tests'); // required for side effects
|
||||
|
||||
import { expect } from 'chai';
|
||||
import mock = require('mock-require');
|
||||
import { promises as fs } from 'fs';
|
||||
|
@ -15,9 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
require('../config-tests'); // required for side effects
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
|
@ -15,9 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
require('../config-tests'); // required for side effects
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
|
@ -15,18 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setMaxListeners } from '../build/app-common';
|
||||
|
||||
setMaxListeners(35); // it appears that 'nock' adds a bunch of listeners - bug?
|
||||
import { EventEmitter } from 'events';
|
||||
EventEmitter.defaultMaxListeners = 35; // it appears that 'nock' adds a bunch of listeners - bug?
|
||||
// SL: Looks like it's not nock causing this, as have seen the problem triggered from help.spec,
|
||||
// which is not using nock. Perhaps mocha/chai? (unlikely), or something in the CLI?
|
||||
|
||||
import { config as chaiCfg } from 'chai';
|
||||
|
||||
function configChai() {
|
||||
chaiCfg.showDiff = true;
|
||||
// enable diff comparison of large objects / arrays
|
||||
chaiCfg.truncateThreshold = 0;
|
||||
}
|
||||
|
||||
configChai();
|
||||
chaiCfg.showDiff = true;
|
||||
// enable diff comparison of large objects / arrays
|
||||
chaiCfg.truncateThreshold = 0;
|
||||
|
@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import './config-tests'; // required for side effects
|
||||
|
||||
import { execFile } from 'child_process';
|
||||
import intercept = require('intercept-stdout');
|
||||
import * as _ from 'lodash';
|
||||
|
@ -15,9 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// tslint:disable-next-line:no-var-requires
|
||||
require('./../config-tests'); // required for side effects
|
||||
|
||||
import { expect } from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
|
Loading…
x
Reference in New Issue
Block a user