Skip to content
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
5 changes: 3 additions & 2 deletions lib/RunTests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow

const chalk = require('./chalk');
const chokidar = require('chokidar');
const path = require('path');
const readline = require('readline');
const packageInfo = require('../package.json');
Expand Down Expand Up @@ -301,7 +300,9 @@ function runTests(
}
};

watcher = chokidar.watch(alwaysWatched, {
// chokidar takes 10–20 ms to load, and is only needed
// in watch mode, so `require` it late.
watcher = require('chokidar').watch(alwaysWatched, {
ignoreInitial: true,
ignored: FindTests.ignoredDirsGlobs,
disableGlobbing: true,
Expand Down
11 changes: 7 additions & 4 deletions lib/Supervisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const child_process = require('child_process');
const fs = require('fs');
const net = require('net');
const split = require('split');
const XmlBuilder = require('xmlbuilder');
const Report = require('./Report');

function run(
Expand Down Expand Up @@ -218,9 +217,13 @@ function run(
};

console.log(
XmlBuilder.create(xml, {
invalidCharReplacement: invalidCharReplacement,
}).end()
// xmlbuilder takes 10–20 ms to load, and is only needed
// when using the junit report, so `require` it late.
require('xmlbuilder')
.create(xml, {
invalidCharReplacement: invalidCharReplacement,
})
.end()
);
}
}
Expand Down
Loading