Skip to content

Commit 13ed82a

Browse files
miniakcodebytere
andauthored
test: skip 'handles Promise timeouts correctly' when ELECTRON_RUN_AS_NODE is disabled (electron#23949) (electron#24165)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
1 parent 3b062b8 commit 13ed82a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

spec/node-spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const { ipcRenderer, remote } = require('electron');
99
const features = process.electronBinding('features');
1010

1111
const { emittedOnce } = require('./events-helpers');
12+
const { ifit } = require('./spec-helpers');
1213

1314
const isCI = remote.getGlobal('isCi');
1415
chai.use(dirtyChai);
@@ -691,7 +692,7 @@ describe('node feature', () => {
691692
expect(result.status).to.equal(0);
692693
});
693694

694-
it('handles Promise timeouts correctly', (done) => {
695+
ifit(features.isRunAsNodeEnabled())('handles Promise timeouts correctly', (done) => {
695696
const scriptPath = path.join(fixtures, 'module', 'node-promise-timer.js');
696697
const child = ChildProcess.spawn(process.execPath, [scriptPath], {
697698
env: { ELECTRON_RUN_AS_NODE: 'true' }

spec/spec-helpers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exports.ifit = (condition) => (condition ? it : it.skip);
2+
exports.ifdescribe = (condition) => (condition ? describe : describe.skip);

0 commit comments

Comments
 (0)