node/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js
Rich Trott 330f25ef82 test: prepare for consistent comma-dangle lint rule
Make changes so that tests will pass when the comma-dangle settings
applied to the rest of the code base are also applied to tests.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-04-01 23:14:29 -07:00

20 lines
693 B
JavaScript

// Flags: --expose-internals
'use strict';
require('../common');
// This test ensures that unnecessary prototypes are no longer
// being generated by Environment::NewFunctionTemplate.
const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
[
internalBinding('udp_wrap').UDP.prototype.bind6,
internalBinding('tcp_wrap').TCP.prototype.bind6,
internalBinding('udp_wrap').UDP.prototype.send6,
internalBinding('tcp_wrap').TCP.prototype.bind,
internalBinding('udp_wrap').UDP.prototype.close,
internalBinding('tcp_wrap').TCP.prototype.open,
].forEach((binding, i) => {
assert.strictEqual('prototype' in binding, false, `Test ${i} failed`);
});