Skip to content

Commit 3a2486e

Browse files
committedDec 16, 2018
Do not run "Leaks ignores Counter globals" on Windows Node >= 11.
Use rimraf.sync instead of fs.rmdirSync to delete directories in tests, in order to prevent spurious ENOENT errors on Windows.
1 parent b169b65 commit 3a2486e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
 

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"cpr": "3.0.x",
3232
"eslint-plugin-markdown": "1.0.0-rc.0",
3333
"lab-event-reporter": "1.x.x",
34-
"rimraf": "2.6.x"
34+
"rimraf": "2.6.x",
35+
"semver": "5.6.x"
3536
},
3637
"bin": {
3738
"lab": "./bin/lab"

‎test/leaks.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Load modules
44

55
const Code = require('code');
6+
const Semver = require('semver');
67
const _Lab = require('../test_runner');
78
const Lab = require('../');
89

@@ -100,7 +101,7 @@ describe('Leaks', () => {
100101
expect(leaks.length).to.equal(0);
101102
});
102103

103-
it('ignores Counter globals', () => {
104+
it('ignores Counter globals', { skip: process.platform === 'win32' && Semver.gte(process.version, '11.0.0') }, () => {
104105

105106
const counterGlobals = internals.counterGlobals;
106107
testedKeys = internals.counterGlobals;

‎test/reporters.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const Crypto = require('crypto');
66
const Fs = require('fs');
77
const Os = require('os');
88
const Path = require('path');
9+
const Rimraf = require('rimraf');
910
const Stream = require('stream');
1011
const Code = require('code');
1112
const _Lab = require('../test_runner');
@@ -101,8 +102,7 @@ describe('Reporter', () => {
101102

102103
expect(code).to.equal(0);
103104
expect(output).to.equal(Fs.readFileSync(filename).toString());
104-
Fs.unlinkSync(filename);
105-
Fs.rmdirSync(folder);
105+
Rimraf.sync(folder);
106106
});
107107

108108
it('outputs to a file with output is passed as an array and reporter is an array', async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.