0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-buffer-isencoding.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

39 lines
483 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
[
'hex',
'utf8',
'utf-8',
'ascii',
'latin1',
'binary',
'base64',
'base64url',
'ucs2',
'ucs-2',
'utf16le',
'utf-16le',
].forEach((enc) => {
assert.strictEqual(Buffer.isEncoding(enc), true);
});
[
'utf9',
'utf-7',
'Unicode-FTW',
'new gnu gun',
false,
NaN,
{},
Infinity,
[],
1,
0,
-1,
].forEach((enc) => {
assert.strictEqual(Buffer.isEncoding(enc), false);
});