mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: fix typos
PR-URL: https://github.com/nodejs/node/pull/55063 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
bf11e5793b
commit
28c7394319
@ -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(
|
||||
|
@ -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': {
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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');
|
||||
@ -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, {
|
||||
|
2
test/fixtures/snapshot/marked.js
vendored
2
test/fixtures/snapshot/marked.js
vendored
@ -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);
|
||||
}
|
||||
|
@ -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 () => {});
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
@ -31,7 +31,7 @@ var window_received_overscroll = false;
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -14,7 +14,7 @@
|
||||
<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');
|
||||
|
@ -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");
|
||||
|
2
test/fixtures/wpt/resources/channel.sub.js
vendored
2
test/fixtures/wpt/resources/channel.sub.js
vendored
@ -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.
|
||||
*
|
||||
*/
|
||||
|
2
test/fixtures/wpt/resources/idlharness.js
vendored
2
test/fixtures/wpt/resources/idlharness.js
vendored
@ -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) {
|
||||
|
@ -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) {
|
||||
|
2
test/fixtures/wpt/resources/testharness.js
vendored
2
test/fixtures/wpt/resources/testharness.js
vendored
@ -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.
|
||||
*
|
||||
*/
|
||||
|
@ -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(()=>{
|
||||
|
@ -256,7 +256,7 @@ function postMessageToWorkerWorkerCode(workerName, channelName) {
|
||||
// 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');
|
||||
}
|
||||
});
|
||||
|
@ -57,7 +57,7 @@ promise_test(async t => {
|
||||
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,
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
//
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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',
|
||||
));
|
||||
|
@ -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');
|
||||
|
@ -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
|
||||
|
@ -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)) {
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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.
|
||||
|
@ -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:auth@www.example.com',
|
||||
'http://asdf:qwer@www.example.com',
|
||||
'http://diff:auth@www.example.com/'],
|
||||
|
@ -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),
|
||||
]);
|
||||
|
@ -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.
|
||||
|
||||
{
|
||||
|
@ -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');
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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 });
|
||||
|
@ -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')}`);
|
||||
|
Loading…
Reference in New Issue
Block a user