Skip to content
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

test: fix typos #55341

Open
wants to merge 3 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 @@ -171,7 +171,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 @@ -210,12 +210,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/fixtures/dotenv/basic-valid.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BASIC=overriden
BASIC=overridden
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());
2 changes: 1 addition & 1 deletion test/fixtures/wpt/FileAPI/support/send-file-form-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const formPostFileUploadTest = ({

// Used to verify that the browser agrees with the test about
// field value replacement and encoding independently of file system
// idiosyncrasies.
// idiosyncracies.
form.append(Object.assign(document.createElement('input'), {
type: 'hidden',
name: 'filename',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const formDataPostFileUploadTest = ({

// Used to verify that the browser agrees with the test about
// field value replacement and encoding independently of file system
// idiosyncrasies.
// idiosyncracies.
formData.append("filename", fileBaseName);

// Same, but with name and value reversed to ensure field names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

function onOverscroll(event) {
assert_false(event.cancelable);
// overscroll events targeting document are bubbled to the window.
// overscroll events targetting document are bubbled to the window.
assert_true(event.bubbles);
window_received_overscroll = true;
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/dom/events/scrolling/scroll_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const MAX_UNCHANGED_FRAMES = 20;
function waitFor(condition, error_message = 'Reaches the maximum frames.') {
return new Promise((resolve, reject) => {
function tick(frames) {
// We requestAnimationFrame either for MAX_FRAME frames or until condition
// We requestAnimationFrame either for MAX_FRAM frames or until condition
// is met.
if (frames >= MAX_FRAME)
reject(error_message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>Description</h1>
<p>Test that a reused resource only appears in the buffer once.</p>
<script>
// Need our own image loading helper because the one in resource-loaders.js
// is designed to always side-step the HTTP cache but this test relies on the
// is desgined to always side-step the HTTP cache but this test relies on the
// second request being resolved from the cache.
const load_image = path => new Promise(resolve => {
const img = document.createElement('img');
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/resource-timing/initiator-type/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script>
initiator_type_test("nested.css", "link", "<link>");

// Verify there are entries for each of nested.css' nested resources.
// Verify there are enries for each of nested.css' nested resources.
initiator_type_test("resource_timing_test0.css?id=n1", "css", "css resources embedded in css");
initiator_type_test("fonts/Ahem.ttf?id=n1", "css", "font resources embedded in css");
initiator_type_test("blue.png?id=n1", "css", "image resources embedded in css");
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/resources/channel.sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
*
* @param {SendChannel|string} [dest] - Either a SendChannel
* to the destination, or the UUID of the destination. If
* omitted, a new UUID is generated, which can be used when
* ommitted, a new UUID is generated, which can be used when
* constructing the URL for the global.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/resources/idlharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ IdlArray.prototype.merge_partials = function()
{
// Special-case "Exposed". Must be a subset of original interface's exposure.
// Exposed on a partial is the equivalent of having the same Exposed on all nested members.
// See https://github.com/heycam/webidl/issues/154 for discrepancy between Exposed and
// See https://github.com/heycam/webidl/issues/154 for discrepency between Exposed and
// other extended attributes on partial interfaces.
const exposureAttr = parsed_idl.extAttrs.find(a => a.name === "Exposed");
if (exposureAttr) {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/resources/testdriver-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* await actions.send();
*
* @param {number} [defaultTickDuration] - The default duration of a
* tick. Be default this is set to 16ms, which is one frame time
* tick. Be default this is set ot 16ms, which is one frame time
* based on 60Hz display.
*/
function Actions(defaultTickDuration=16) {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/resources/testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@

/**
* @callback TestFunction
* @param {Test} test - The test currently being run.
* @param {Test} test - The test currnetly being run.
* @param {Any[]} args - Additional args to pass to function.
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function transferMessagePortWith(constructor) {
await transferMessagePortWithOrder3(new constructor());
}

async function advancedTransferMessagePortWith(constructor) {
async function advancedTransferMesagePortWith(constructor) {
await transferMessagePortWithOrder4(new constructor());
await transferMessagePortWithOrder5(new constructor());
await transferMessagePortWithOrder6(new constructor());
Expand Down Expand Up @@ -166,7 +166,7 @@ async function mixedTransferMessagePortWithOrder3() {
);
}

async function mixedTransferMessagePortWith() {
async function mixedTransferMesagePortWith() {
await mixedTransferMessagePortWithOrder1();
await mixedTransferMessagePortWithOrder2();
await mixedTransferMessagePortWithOrder3();
Expand Down Expand Up @@ -197,7 +197,7 @@ promise_test(async t => {
}, "Transferring a MessagePort with a TransformStream should set `.ports`, advanced");

promise_test(async t => {
await mixedTransferMessagePortWith();
await mixedTransferMesagePortWith();
}, "Transferring a MessagePort with multiple streams should set `.ports`");

test(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/user-timing/measure-exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

const args = [
51.15, // Verify that number is parsed as string, not number.
"DoesNotExist", // Non-existent mark name should cause error.
"DoesNotExist", // Non-existant mark name should cause error.
];
args.forEach(each => {
test(()=>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
for (let id in ids) {
assert_true(id !== undefined, "id is not undefined");
}
// Note: we use assert_true, rather than assert_equals because we're
// Note: we use assert_true, rather than assert_equals becuase we're
// setting random numbers as IDs - this would mean expectations
// files wouldn't work as intended.
assert_true(crossSiteIframeAboutBlankID !== crossSiteIframeID,
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
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
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
4 changes: 2 additions & 2 deletions test/parallel/test-process-exit-code-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ if (process.argv[2] === undefined) {

// Check process.exitCode
for (const arg of invalids) {
debug(`invaild code: ${inspect(arg.code)}`);
debug(`invalid code: ${inspect(arg.code)}`);
throws(() => (process.exitCode = arg.code), new RegExp(arg.pattern));
}
for (const arg of valids) {
debug(`vaild code: ${inspect(arg.code)}`);
debug(`valid code: ${inspect(arg.code)}`);
process.exitCode = arg.code;
}

Expand Down
Loading
Loading