Skip to content

Commit

Permalink
test: fix typos
Browse files Browse the repository at this point in the history
PR-URL: nodejs#55063
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
NathanBaulch authored and louwers committed Nov 2, 2024
1 parent dcab209 commit 895c8fa
Show file tree
Hide file tree
Showing 43 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion test/addons/non-node-context/test-make-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
makeBufferInNewContext,
} = require(`./build/${common.buildType}/binding`);

// Because the `Buffer` function and its protoype property only (currently)
// Because the `Buffer` function and its prototype property only (currently)
// exist in a Node.js instance’s main context, trying to create buffers from
// another context throws an exception.
assert.throws(
Expand Down
2 changes: 1 addition & 1 deletion test/addons/openssl-providers/providers.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { getProviders } = require(`./build/${common.buildType}/binding`);

// For the providers defined here, the expectation is that the listed ciphers
// and hash algorithms are only provided by the named provider. These are for
// basic checks and are not intended to list evey cipher or hash algorithm
// basic checks and are not intended to list every cipher or hash algorithm
// supported by the provider.
const providers = {
'default': {
Expand Down
2 changes: 1 addition & 1 deletion test/common/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function _validateContent(report, fields = []) {
assert(typeof usage.free_memory, 'string');
assert(typeof usage.total_memory, 'string');
assert(typeof usage.available_memory, 'string');
// This field may not exsit
// This field may not exist
if (report.resourceUsage.constrained_memory) {
assert(typeof report.resourceUsage.constrained_memory, 'string');
}
Expand Down
4 changes: 2 additions & 2 deletions test/es-module/test-wasm-web-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) {
"'application/octet-stream'"
});

// HTTP status code indiciating an error.
// HTTP status code indicating an error.
await testCompileStreamingRejectionUsingFetch((res) => {
res.statusCode = 418;
res.setHeader('Content-Type', 'application/wasm');
Expand All @@ -184,7 +184,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) {
message: /^WebAssembly response has status code 418$/
});

// HTTP status code indiciating an error, but using a Response whose body is
// HTTP status code indicating an error, but using a Response whose body is
// a Buffer instead of calling fetch().
await testCompileStreamingSuccess(() => {
return Promise.resolve(new Response(simpleWasmBytes, {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/snapshot/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
} else {
indent = cap[2].search(/[^ ]/); // Find first non-space char

indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1
indent = cap[1].length + (indent > 4 ? 1 : indent); // indented code blocks after 4 spaces; indent is always 1

itemContents = lines[0].slice(indent - cap[1].length);
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/test-runner/coverage-loader/hooks.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const sources = {
// Virtual file. Dosen't exist on disk
// Virtual file. Doesn't exist on disk
"virtual.js": `
import { test } from 'node:test';
test('test', async () => {});
Expand Down
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
// idiosyncracies.
// idiosyncrasies.
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
// idiosyncracies.
// idiosyncrasies.
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 targetting document are bubbled to the window.
// overscroll events targeting 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_FRAM frames or until condition
// We requestAnimationFrame either for MAX_FRAME 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 desgined to always side-step the HTTP cache but this test relies on the
// is designed 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 enries for each of nested.css' nested resources.
// Verify there are entries 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
* ommitted, a new UUID is generated, which can be used when
* omitted, 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 discrepency between Exposed and
// See https://github.com/heycam/webidl/issues/154 for discrepancy 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 ot 16ms, which is one frame time
* tick. Be default this is set to 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 currnetly being run.
* @param {Test} test - The test currently being run.
* @param {Any[]} args - Additional args to pass to function.
*
*/
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-existant mark name should cause error.
"DoesNotExist", // Non-existent mark name should cause error.
];
args.forEach(each => {
test(()=>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
// Since the worker has closed, it's not expected that the
// BroadcastChannel will receive messages (there's a separate test for
// that), so just indicate directly that it's ready to test receiving
// a message from the parent dispite the possibility of a race condition.
// a message from the parent despite the possibility of a race condition.
postMessage('ready');
}
});
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 becuase we're
// Note: we use assert_true, rather than assert_equals because 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/internet/test-uv-threadpool-schedule.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Test to validate massive dns lookups do not block filesytem I/O
// Test to validate massive dns lookups do not block filesystem I/O
// (or any fast I/O). Prior to https://github.com/libuv/libuv/pull/1845
// few back-to-back dns lookups were sufficient to engage libuv
// threadpool workers in a blocking manner, throttling other work items
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_function/test_function.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static napi_value TestBadReturnExceptionPending(napi_env env, napi_callback_info
// exception occurs, but we have seen that the C++ wrapper
// with exceptions enabled sometimes returns an invalid value
// when an exception is thrown. Test that we ignore the return
// value then an exeption is pending. We use 0xFFFFFFFF as a value
// value then an exception is pending. We use 0xFFFFFFFF as a value
// that should never be a valid napi_value and node seems to
// crash if it is not ignored indicating that it is indeed invalid.
return (napi_value)(0xFFFFFFFFF);
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_object/test_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ TypeTaggedInstance(napi_env env, napi_callback_info info) {
return instance;
}

// V8 will not allowe us to construct an external with a NULL data value.
// V8 will not allow us to construct an external with a NULL data value.
#define IN_LIEU_OF_NULL ((void*)0x1)

static napi_value PlainExternal(napi_env env, napi_callback_info info) {
Expand Down
2 changes: 1 addition & 1 deletion test/js-native-api/test_reference/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ runTests();
// reference (there is a finalizer behind the scenes even
// though it cannot be passed to napi_create_reference).
//
// Since the order is not guarranteed, run the
// Since the order is not guaranteed, run the
// test a number of times maximize the chance that we
// get a run with the desired order for the test.
//
Expand Down
2 changes: 1 addition & 1 deletion test/node-api/test_init_order/test_init_order.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace {
// In production code developers must avoid dynamic static initializers because
// they affect the start up time. They must prefer static initialization such as
// use of constexpr functions or classes with constexpr constructors. E.g.
// instead of using std::string, it is preferrable to use const char[], or
// instead of using std::string, it is preferable to use const char[], or
// constexpr std::string_view starting with C++17, or even constexpr
// std::string starting with C++20.
struct MyClass {
Expand Down
2 changes: 1 addition & 1 deletion test/node-api/test_instance_data/test_instance_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void FinalizeThreadsafeFunction(napi_env env, void* raw, void* hint) {
data->tsfn = NULL;
}

// Ths function accepts two arguments: the JS callback, and the finalize
// This function accepts two arguments: the JS callback, and the finalize
// callback. The latter moves the test forward.
static napi_value
TestThreadsafeFunction(napi_env env, napi_callback_info info) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test-fs-read-stream-concurrent-reads: PASS, FLAKY

# Until V8 provides a better way to check for flag mismatch without
# making the code cache/snapshot unreproducible, disable the test
# for a preemptive check now. It should idealy fail more gracefully
# for a preemptive check now. It should ideally fail more gracefully
# with a better checking mechanism.
# https://github.com/nodejs/build/issues/3043
test-snapshot-incompatible: SKIP
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-blob-file-backed.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ writeFileSync(testfile5, '');
})().then(common.mustCall());

(async () => {
// We currently do not allow File-backed blobs to be cloned or transfered
// We currently do not allow File-backed blobs to be cloned or transferred
// across worker threads. This is largely because the underlying FdEntry
// is bound to the Environment/Realm under which is was created.
const blob = await openAsBlob(__filename);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cli-options-negation.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ assert(spawnWithFlags(['--no-max-http-header-size']).stderr.toString().includes(
'a boolean option',
));

// Inexistant flags cannot be negated.
// Inexistent flags cannot be negated.
assert(spawnWithFlags(['--no-i-dont-exist']).stderr.toString().includes(
'bad option: --no-i-dont-exist',
));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-compile-cache-api-tmpdir.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

// This tests module.enableCompileCache() and module.getCompileCacheDir() work with
// the TMPDIR environemnt variable override.
// the TMPDIR environment variable override.

require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-x509.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0
// Test date parsing of `validFromDate` and `validToDate` fields, according to RFC 5280.

// Validity dates up until the year 2049 are encoded as UTCTime.
// The fomatting of UTCTime changes from the year ~1949 to 1950~.
// The formatting of UTCTime changes from the year ~1949 to 1950~.
const certPemUTCTime = `-----BEGIN CERTIFICATE-----
MIIE/TCCAuWgAwIBAgIUHbXPaFnjeBehMvdHkXZ+E3a78QswDQYJKoZIhvcNAQEL
BQAwDTELMAkGA1UEBhMCS1IwIBgPMTk0OTEyMjUyMzU5NThaFw01MDAxMDEyMzU5
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-watch-recursive-update-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fs.writeFileSync(testFile, 'hello');

const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', common.mustCallAtLeast(function(event, filename) {
// Libuv inconsistenly emits a rename event for the file we are watching
// Libuv inconsistently emits a rename event for the file we are watching
assert.ok(event === 'change' || event === 'rename');

if (filename === path.basename(testFile)) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-inspector-break-when-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function stepOverConsoleStatement(session) {
}

async function runTests() {
// NOTE(mmarchini): Use --inspect-brk to improve avoid undeterministic
// NOTE(mmarchini): Use --inspect-brk to improve avoid indeterministic
// behavior.
const child = new NodeInstance(['--inspect-brk=0'], undefined, script);
const session = await child.connectInspectorSession();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-net-listen-twice.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (cluster.isPrimary) {
server.listen();
try {
// Currently, we can call `listen` twice in cluster worker,
// if we can not call `listen` twice in the futrue,
// if we can not call `listen` twice in the future,
// just skip this test.
server.listen();
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-net-pipe-with-long-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const server = net.createServer()
.listen(pipePath)
// It may work on some operating systems
.on('listening', () => {
// The socket file must exsit
// The socket file must exist
assert.ok(fs.existsSync(pipePath));
const socket = net.connect(pipePath, common.mustCall(() => {
socket.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const common = require('../common');
//
// The root cause of this issue is that before PerIsolateMessageListener()
// is invoked by v8, v8 preserves the JS vm state, although it should
// switch to EXTERNEL. https://bugs.chromium.org/p/v8/issues/detail?id=13464
// switch to EXTERNAL. https://bugs.chromium.org/p/v8/issues/detail?id=13464
//
// Therefore, this commit can be considered as an workaround of the v8 bug,
// but we also find it not useful to call SetIdle() when terminating.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-url-relative.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ const relativeTests2 = [
'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'],
['../b/c', 'foo:a/y/z', 'foo:a/b/c'],

// changeing auth
// changing auth
['http://diff:[email protected]',
'http://asdf:[email protected]',
'http://diff:[email protected]/'],
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-v8-query-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ common.expectWarning(
class TestV8QueryObjectsChildClass extends TestV8QueryObjectsBaseClass {}
const summary = v8.queryObjects(TestV8QueryObjectsBaseClass, { format: 'summary' });
// TestV8QueryObjectsChildClass's prototype's [[Prototype]] slot is
// TestV8QueryObjectsBaseClass's prototoype so it shows up in the query.
// TestV8QueryObjectsBaseClass's prototype so it shows up in the query.
assert.deepStrictEqual(summary, [
format(TestV8QueryObjectsChildClass.prototype),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common');
const assert = require('assert');
const { MessageChannel } = require('worker_threads');

// Test that passing duplicate transferrables in the transfer list throws
// Test that passing duplicate transferables in the transfer list throws
// DataCloneError exceptions.

{
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-worker-message-port-wasm-threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common');
const assert = require('assert');
const { MessageChannel, Worker } = require('worker_threads');

// Test that SharedArrayBuffer instances created from WASM are transferrable
// Test that SharedArrayBuffer instances created from WASM are transferable
// through MessageChannels (without crashing).

const fixtures = require('../common/fixtures');
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-error-serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ assert.strictEqual(Object.hasOwn(cycle(errorWithCyclicCause), 'cause'), true);
assert.deepStrictEqual(cycle(new ErrorWithCause('Error with cause')).cause, new Error('err'));
assert.strictEqual(cycle(new ErrorWithThowingCause('Error with cause')).cause, undefined);
assert.strictEqual(Object.hasOwn(cycle(new ErrorWithThowingCause('Error with cause')), 'cause'), false);
// When the cause is cyclic, it is serialized until Maxiumum call stack size is reached
// When the cause is cyclic, it is serialized until Maximum call stack size is reached
let depth = 0;
let e = cycle(new ErrorWithCyclicCause('Error with cause'));
while (e.cause) {
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-performance-eventloopdelay.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ const { sleep } = require('internal/util');
}

// Make sure that the histogram instances can be garbage-collected without
// and not just implictly destroyed when the Environment is torn down.
// and not just implicitly destroyed when the Environment is torn down.
process.on('exit', global.gc);
2 changes: 1 addition & 1 deletion test/sequential/test-worker-eventlooputil.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let workerELU;
metricsCh.port2.once('message', mustCall(checkWorkerIdle));
metricsCh.port2.postMessage({ cmd: 'elu' });
// Make sure it's still safe to call eventLoopUtilization() after the worker
// hass been closed.
// has been closed.
worker.on('exit', mustCall(() => {
assert.deepStrictEqual(worker.performance.eventLoopUtilization(),
{ idle: 0, active: 0, utilization: 0 });
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-worker-prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (process.argv[2] === 'child') {
console.log('parent ticks', parentTicks.length);
// When not tracking Worker threads, only 1 or 2 ticks would
// have been recorded.
// prof_sampling_interval is by default 1 millsecond. A higher NODE_TEST_SPIN_MS
// prof_sampling_interval is by default 1 millisecond. A higher NODE_TEST_SPIN_MS
// should result in more ticks, while 15 should be safe on most machines.
assert(workerTicks.length > 15, `worker ticks <= 15:\n${workerTicks.join('\n')}`);
assert(parentTicks.length > 15, `parent ticks <= 15:\n${parentTicks.join('\n')}`);
Expand Down

0 comments on commit 895c8fa

Please sign in to comment.