Skip to content

Commit

Permalink
change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
anpaul0615 committed Oct 14, 2019
1 parent 96d4767 commit 3c610ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/cli/watch-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ const createRerunner = (mocha, beforeRun) => {

let rerunScheduled = false;

let defaultGlobals = null;
let initialGlobals = null;

const run = () => {
try {
beforeRun();
resetMocha(mocha);

if (!defaultGlobals) {
defaultGlobals = Object.keys(global);
if (!initialGlobals) {
initialGlobals = Object.keys(global);
}

runner = mocha.run(() => {
Expand Down Expand Up @@ -121,13 +121,13 @@ const createRerunner = (mocha, beforeRun) => {
};

const rerun = () => {
if (defaultGlobals) {
if (initialGlobals) {
Object.keys(global).forEach(k => {
if (defaultGlobals.indexOf(k) === -1) {
if (initialGlobals.indexOf(k) === -1) {
delete global[k];
}
});
defaultGlobals = null;
initialGlobals = null;
}

rerunScheduled = false;
Expand Down

0 comments on commit 3c610ca

Please sign in to comment.