Skip to content

test: fix typos #55341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const buildType = process.config.target_defaults ?

// If env var is set then enable async_hook hooks for all tests.
if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {
const destroydIdsList = {};
const destroyedIdsList = {};
const destroyListList = {};
const initHandles = {};
const { internalBinding } = require('internal/test/binding');
Expand Down Expand Up @@ -187,12 +187,12 @@ if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {
before() { },
after() { },
destroy(id) {
if (destroydIdsList[id] !== undefined) {
process._rawDebug(destroydIdsList[id]);
if (destroyedIdsList[id] !== undefined) {
process._rawDebug(destroyedIdsList[id]);
process._rawDebug();
throw new Error(`destroy called for same id (${id})`);
}
destroydIdsList[id] = inspect(new Error());
destroyedIdsList[id] = inspect(new Error());
},
}).enable();
}
Expand Down
2 changes: 1 addition & 1 deletion test/es-module/test-esm-nowarn-exports.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { execPath } from 'node:process';
import { describe, it } from 'node:test';


describe('ESM: experiemental warning for import.meta.resolve', { concurrency: !process.env.TEST_PARALLEL }, () => {
describe('ESM: experimental warning for import.meta.resolve', { concurrency: !process.env.TEST_PARALLEL }, () => {
it('should not warn when caught', async () => {
const { code, signal, stderr } = await spawnPromisified(execPath, [
'--experimental-import-meta-resolve',
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/dotenv/basic-valid.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BASIC=overriden
BASIC=overridden
8 changes: 4 additions & 4 deletions test/fixtures/guess-hash-seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function time_set_lookup(set, value) {
// Set with 256 buckets; bucket 0 full, others empty
const tester_set_buckets = 256;
const tester_set = new Set();
let tester_set_treshold;
let tester_set_threshold;
(function() {
// fill bucket 0 and find extra numbers mapping to bucket 0 and a different
// bucket `capacity == numBuckets * 2`
Expand Down Expand Up @@ -114,9 +114,9 @@ let tester_set_treshold;
const neg_time =
Math.min(...run_repeated(10000, time_set_lookup.bind(null, tester_set,
negative_test_value)));
tester_set_treshold = (pos_time + neg_time) / 2;
tester_set_threshold = (pos_time + neg_time) / 2;
// console.log(`pos_time: ${pos_time}, neg_time: ${neg_time},`,
// `threshold: ${tester_set_treshold}`);
// `threshold: ${tester_set_threshold}`);
})();

// determine hash seed
Expand All @@ -126,7 +126,7 @@ const slow_str_gen = (function*() {
while (1) {
const str = `#${strgen_i++}`;
for (let i = 0; i < 1000; i++) {
if (time_set_lookup(tester_set, str) < tester_set_treshold)
if (time_set_lookup(tester_set, str) < tester_set_threshold)
continue outer;
}
yield str;
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/snapshot/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -2177,19 +2177,19 @@

_proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) {
var slug = originalSlug;
var occurenceAccumulator = 0;
var occurrenceAccumulator = 0;

if (this.seen.hasOwnProperty(slug)) {
occurenceAccumulator = this.seen[originalSlug];
occurrenceAccumulator = this.seen[originalSlug];

do {
occurenceAccumulator++;
slug = originalSlug + '-' + occurenceAccumulator;
occurrenceAccumulator++;
slug = originalSlug + '-' + occurrenceAccumulator;
} while (this.seen.hasOwnProperty(slug));
}

if (!isDryRun) {
this.seen[originalSlug] = occurenceAccumulator;
this.seen[originalSlug] = occurrenceAccumulator;
this.seen[slug] = 0;
}

Expand Down
278 changes: 139 additions & 139 deletions test/fixtures/snapshot/typescript.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/test-runner/output/skip_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ it.skip('top level skipped it enabled', common.mustNotCall());
describe('top level describe', common.mustCall());
describe.skip('top level skipped describe disabled', common.mustNotCall());
describe.skip('top level skipped describe enabled', common.mustNotCall());
test('this will NOt call', common.mustNotCall());
test('this will NOT call', common.mustNotCall());
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,7 @@ index 0000000000..0f7a3c1cb1
+ },
+ {
+ "name": "sourceRootResolution",
+ "description": "Similar to basic mapping test, but test resoultion of sources with a sourceRoot field",
+ "description": "Similar to basic mapping test, but test resolution of sources with a sourceRoot field",
+ "baseFile": "source-root-resolution.js",
+ "sourceMapFile": "source-root-resolution.js.map",
+ "sourceMapIsValid": true,
Expand All @@ -2541,7 +2541,7 @@ index 0000000000..0f7a3c1cb1
+ },
+ {
+ "name": "sourceResolutionAbsoluteURL",
+ "description": "Test resoultion of sources with absolute URLs",
+ "description": "Test resolution of sources with absolute URLs",
+ "baseFile": "source-resolution-absolute-url.js",
+ "sourceMapFile": "source-resolution-absolute-url.js.map",
+ "sourceMapIsValid": true,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/fixtures/test426/source-map-spec-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@
},
{
"name": "sourceRootResolution",
"description": "Similar to basic mapping test, but test resoultion of sources with a sourceRoot field",
"description": "Similar to basic mapping test, but test resolution of sources with a sourceRoot field",
"baseFile": "source-root-resolution.js",
"sourceMapFile": "source-root-resolution.js.map",
"sourceMapIsValid": true,
Expand All @@ -705,7 +705,7 @@
},
{
"name": "sourceResolutionAbsoluteURL",
"description": "Test resoultion of sources with absolute URLs",
"description": "Test resolution of sources with absolute URLs",
"baseFile": "source-resolution-absolute-url.js",
"sourceMapFile": "source-resolution-absolute-url.js.map",
"sourceMapIsValid": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,7 @@ index 000000000000..c5fbd4baa8b0
++ },
++ {
++ "name": "sourceRootResolution",
++ "description": "Similar to basic mapping test, but test resoultion of sources with a sourceRoot field",
++ "description": "Similar to basic mapping test, but test resolution of sources with a sourceRoot field",
++ "baseFile": "source-root-resolution.js",
++ "sourceMapFile": "source-root-resolution.js.map",
++ "sourceMapIsValid": true,
Expand All @@ -3424,7 +3424,7 @@ index 000000000000..c5fbd4baa8b0
++ },
++ {
++ "name": "sourceResolutionAbsoluteURL",
++ "description": "Test resoultion of sources with absolute URLs",
++ "description": "Test resolution of sources with absolute URLs",
++ "baseFile": "source-resolution-absolute-url.js",
++ "sourceMapFile": "source-resolution-absolute-url.js.map",
++ "sourceMapIsValid": true,
Expand Down Expand Up @@ -7950,7 +7950,7 @@ index 000000000000..4601502fffd6
+ },
+ {
+ "name": "sourceRootResolution",
+ "description": "Similar to basic mapping test, but test resoultion of sources with a sourceRoot field",
+ "description": "Similar to basic mapping test, but test resolution of sources with a sourceRoot field",
+ "baseFile": "source-root-resolution.js",
+ "sourceMapFile": "source-root-resolution.js.map",
+ "sourceMapIsValid": true,
Expand All @@ -7977,7 +7977,7 @@ index 000000000000..4601502fffd6
+ },
+ {
+ "name": "sourceResolutionAbsoluteURL",
+ "description": "Test resoultion of sources with absolute URLs",
+ "description": "Test resolution of sources with absolute URLs",
+ "baseFile": "source-resolution-absolute-url.js",
+ "sourceMapFile": "source-resolution-absolute-url.js.map",
+ "sourceMapIsValid": true,
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_string/test_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static napi_status validate_and_retrieve_single_string_arg(

NODE_API_ASSERT_STATUS(env,
valuetype == napi_string,
"Wrong type of argment. Expects a string.");
"Wrong type of argument. Expects a string.");

return napi_ok;
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test('should not override NODE_OPTIONS', async () => {
strictEqual(result.code, 1);
});

test('should not ovverride CLI flags', async () => {
test('should not override CLI flags', async () => {
const result = await spawnPromisified(process.execPath, [
'--no-warnings',
'--no-experimental-transform-types',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-sec-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!common.hasCrypto)
const assert = require('assert');

// OpenSSL has a set of security levels which affect what algorithms
// are available by default. Different OpenSSL veresions have different
// are available by default. Different OpenSSL versions have different
// default security levels and we use this value to adjust what a test
// expects based on the security level. You can read more in
// https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_security_level/#default-callback-behaviour
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-debugger-set-context-line-number.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function onFatal(error) {
}

function getLastLine(output) {
const splittedByLine = output.split(';');
return splittedByLine[splittedByLine.length - 2];
const splitByLine = output.split(';');
return splitByLine[splitByLine.length - 2];
}

// Stepping through breakpoints.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-glob.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ describe('fsPromises glob', function() {

const normalizeDirent = (dirent) => relative(fixtureDir, join(dirent.parentPath, dirent.name));
// The call to `join()` with only one argument is important, as
// it ensures that the proper path seperators are applied.
// it ensures that the proper path separators are applied.
const normalizePath = (path) => (isAbsolute(path) ? relative(fixtureDir, path) : join(path));

describe('glob - withFileTypes', function() {
Expand Down
16 changes: 8 additions & 8 deletions test/parallel/test-fs-readv-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

const expected = 'ümlaut. Лорем 運務ホソモ指及 आपको करने विकास 紙読決多密所 أضف';
const exptectedBuff = Buffer.from(expected);
const expectedBuff = Buffer.from(expected);

let cnt = 0;
function getFileName() {
Expand All @@ -16,7 +16,7 @@ function getFileName() {

const allocateEmptyBuffers = (combinedLength) => {
const bufferArr = [];
// Allocate two buffers, each half the size of exptectedBuff
// Allocate two buffers, each half the size of expectedBuff
bufferArr[0] = Buffer.alloc(Math.floor(combinedLength / 2));
bufferArr[1] = Buffer.alloc(combinedLength - bufferArr[0].length);

Expand All @@ -26,10 +26,10 @@ const allocateEmptyBuffers = (combinedLength) => {
(async () => {
{
const filename = getFileName();
await fs.writeFile(filename, exptectedBuff);
await fs.writeFile(filename, expectedBuff);
const handle = await fs.open(filename, 'r');
const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const expectedLength = exptectedBuff.length;
const bufferArr = allocateEmptyBuffers(expectedBuff.length);
const expectedLength = expectedBuff.length;

let { bytesRead, buffers } = await handle.readv([Buffer.from('')],
null);
Expand All @@ -45,10 +45,10 @@ const allocateEmptyBuffers = (combinedLength) => {

{
const filename = getFileName();
await fs.writeFile(filename, exptectedBuff);
await fs.writeFile(filename, expectedBuff);
const handle = await fs.open(filename, 'r');
const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const expectedLength = exptectedBuff.length;
const bufferArr = allocateEmptyBuffers(expectedBuff.length);
const expectedLength = expectedBuff.length;

let { bytesRead, buffers } = await handle.readv([Buffer.from('')]);
assert.strictEqual(bytesRead, 0);
Expand Down
12 changes: 6 additions & 6 deletions test/parallel/test-fs-readv-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ tmpdir.refresh();

const expected = 'ümlaut. Лорем 運務ホソモ指及 आपको करने विकास 紙読決多密所 أضف';

const exptectedBuff = Buffer.from(expected);
const expectedLength = exptectedBuff.length;
const expectedBuff = Buffer.from(expected);
const expectedLength = expectedBuff.length;

const filename = tmpdir.resolve('readv_sync.txt');
fs.writeFileSync(filename, exptectedBuff);
fs.writeFileSync(filename, expectedBuff);

const allocateEmptyBuffers = (combinedLength) => {
const bufferArr = [];
// Allocate two buffers, each half the size of exptectedBuff
// Allocate two buffers, each half the size of expectedBuff
bufferArr[0] = Buffer.alloc(Math.floor(combinedLength / 2));
bufferArr[1] = Buffer.alloc(combinedLength - bufferArr[0].length);

Expand All @@ -28,7 +28,7 @@ const allocateEmptyBuffers = (combinedLength) => {
{
const fd = fs.openSync(filename, 'r');

const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const bufferArr = allocateEmptyBuffers(expectedBuff.length);

let read = fs.readvSync(fd, [Buffer.from('')], 0);
assert.strictEqual(read, 0);
Expand All @@ -45,7 +45,7 @@ const allocateEmptyBuffers = (combinedLength) => {
{
const fd = fs.openSync(filename, 'r');

const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const bufferArr = allocateEmptyBuffers(expectedBuff.length);

let read = fs.readvSync(fd, [Buffer.from('')]);
assert.strictEqual(read, 0);
Expand Down
18 changes: 9 additions & 9 deletions test/parallel/test-fs-readv.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const expected = 'ümlaut. Лорем 運務ホソモ指及 आपको कर

let cnt = 0;
const getFileName = () => tmpdir.resolve(`readv_${++cnt}.txt`);
const exptectedBuff = Buffer.from(expected);
const expectedBuff = Buffer.from(expected);

const allocateEmptyBuffers = (combinedLength) => {
const bufferArr = [];
// Allocate two buffers, each half the size of exptectedBuff
// Allocate two buffers, each half the size of expectedBuff
bufferArr[0] = Buffer.alloc(Math.floor(combinedLength / 2));
bufferArr[1] = Buffer.alloc(combinedLength - bufferArr[0].length);

Expand All @@ -25,21 +25,21 @@ const allocateEmptyBuffers = (combinedLength) => {
const getCallback = (fd, bufferArr) => {
return common.mustSucceed((bytesRead, buffers) => {
assert.deepStrictEqual(bufferArr, buffers);
const expectedLength = exptectedBuff.length;
const expectedLength = expectedBuff.length;
assert.deepStrictEqual(bytesRead, expectedLength);
fs.closeSync(fd);

assert(Buffer.concat(bufferArr).equals(exptectedBuff));
assert(Buffer.concat(bufferArr).equals(expectedBuff));
});
};

// fs.readv with array of buffers with all parameters
{
const filename = getFileName();
const fd = fs.openSync(filename, 'w+');
fs.writeSync(fd, exptectedBuff);
fs.writeSync(fd, expectedBuff);

const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const bufferArr = allocateEmptyBuffers(expectedBuff.length);
const callback = getCallback(fd, bufferArr);

fs.readv(fd, bufferArr, 0, callback);
Expand All @@ -48,10 +48,10 @@ const getCallback = (fd, bufferArr) => {
// fs.readv with array of buffers without position
{
const filename = getFileName();
fs.writeFileSync(filename, exptectedBuff);
fs.writeFileSync(filename, expectedBuff);
const fd = fs.openSync(filename, 'r');

const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
const bufferArr = allocateEmptyBuffers(expectedBuff.length);
const callback = getCallback(fd, bufferArr);

fs.readv(fd, bufferArr, callback);
Expand All @@ -64,7 +64,7 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined];

{
const filename = getFileName(2);
fs.writeFileSync(filename, exptectedBuff);
fs.writeFileSync(filename, expectedBuff);
const fd = fs.openSync(filename, 'r');

for (const wrongInput of wrongInputs) {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-net-server-blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ blockList.addAddress(common.localhostIPv4);

const server = net.createServer({ blockList }, common.mustNotCall());
server.listen(0, common.localhostIPv4, common.mustCall(() => {
const adddress = server.address();
const address = server.address();
const socket = net.connect({
localAddress: common.localhostIPv4,
host: adddress.address,
port: adddress.port
host: address.address,
port: address.port
});
socket.on('close', common.mustCall(() => {
server.close();
Expand Down
Loading
Loading