Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/parallel/test-process-exit-from-before-exit.js

10 lines
268 B
JavaScript
Raw Normal View History

test: enable linting for tests Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-19 13:00:06 +02:00
'use strict';
src: emit 'beforeExit' event on process object Unlike the 'exit' event, this event allows the user to schedule more work and thereby postpone the exit. That also means that the 'beforeExit' event may be emitted many times, see the attached test case for an example. Refs #6305.
2013-10-07 15:39:39 +02:00
var assert = require('assert');
var common = require('../common');
process.on('beforeExit', common.mustCall(function() {
setTimeout(assert.fail, 5);
process.exit(0); // Should execute immediately even if we schedule new work.
assert.fail();
}));
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 2828ms Template: 103ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API