node/test/parallel/test-repl-throw-null-or-undefined.js
Ruben Bridgewater 1fc373bdf6
Revert "repl: refactor tests to not rely on timing"
This reverts commit de848ac1e0.

The commit broke multiline repl.

PR-URL: https://github.com/nodejs/node/pull/18715
Refs: https://github.com/nodejs/node/pull/17828
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-12 15:42:06 +01:00

19 lines
443 B
JavaScript

'use strict';
require('../common');
// This test ensures that the repl does not
// crash or emit error when throwing `null|undefined`
// ie `throw null` or `throw undefined`
const assert = require('assert');
const repl = require('repl');
const r = repl.start();
assert.doesNotThrow(() => {
r.write('throw null\n');
r.write('throw undefined\n');
}, TypeError, 'repl crashes/throw error on `throw null|undefined`');
r.write('.exit\n');