test: skip 'handles Promise timeouts correctly' when ELECTRON_RUN_AS_NODE is disabled (#23949) (#24165)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Milan Burda
2020-06-19 18:47:01 +02:00
committed by GitHub
parent 3b062b84b2
commit 13ed82a7d5
2 changed files with 4 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ const { ipcRenderer, remote } = require('electron');
const features = process.electronBinding('features');
const { emittedOnce } = require('./events-helpers');
const { ifit } = require('./spec-helpers');
const isCI = remote.getGlobal('isCi');
chai.use(dirtyChai);
@@ -691,7 +692,7 @@ describe('node feature', () => {
expect(result.status).to.equal(0);
});
it('handles Promise timeouts correctly', (done) => {
ifit(features.isRunAsNodeEnabled())('handles Promise timeouts correctly', (done) => {
const scriptPath = path.join(fixtures, 'module', 'node-promise-timer.js');
const child = ChildProcess.spawn(process.execPath, [scriptPath], {
env: { ELECTRON_RUN_AS_NODE: 'true' }

2
spec/spec-helpers.js Normal file
View File

@@ -0,0 +1,2 @@
exports.ifit = (condition) => (condition ? it : it.skip);
exports.ifdescribe = (condition) => (condition ? describe : describe.skip);