node/test/parallel/test-repl-deprecations.js
Lance Ball 766506a2e9
repl: deprecate REPLServer.parseREPLKeyword
This method does not need to be visible to user code. It has been
undocumented since it was introduced which was perhaps v0.8.9.

The motivation for this change is that the method is simply an
implementation detail of the REPLServer behavior, and does
not need to be exposed to user code.

This change adds documentation of the method with a deprecation
warning, and a test that the method is actually documented.

PR-RUL: https://github.com/nodejs/node/pull/14223
Refs: https://github.com/nodejs/node/issues/7619
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-02 14:39:06 -04:00

17 lines
452 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const repl = require('repl');
testParseREPLKeyword();
function testParseREPLKeyword() {
const server = repl.start({ prompt: '> ' });
const warn = 'REPLServer.parseREPLKeyword() is deprecated';
common.expectWarning('DeprecationWarning', warn);
assert.ok(server.parseREPLKeyword('clear'));
assert.ok(!server.parseREPLKeyword('tacos'));
server.close();
}