| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -194,7 +194,7 @@ export default [ | |||
| 194 | 194 | ].join(',')}}/**/*.{js,mjs,cjs}`, | |
| 195 | 195 | `test/parallel/test-{${ | |
| 196 | 196 | // 0x61 is code for 'a', this generates a string enumerating latin letters: 'a*,b*,…' | |
| 197 | - Array.from({ length: 4 }, (_, i) => String.fromCharCode(0x61 + i, 42)).join(',') | ||
| 197 | + Array.from({ length: 7 }, (_, i) => String.fromCharCode(0x61 + i, 42)).join(',') | ||
| 198 | 198 | },http-*,http2-*,${ | |
| 199 | 199 | // 0x61 is code for 'a', this generates a string enumerating latin letters: 'z*,y*,…' | |
| 200 | 200 | Array.from({ length: 5 }, (_, i) => String.fromCharCode(0x61 + 25 - i, 42)).join(',') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | 4 | const common = require('../common'); | |
| 5 | - const { strictEqual } = require('node:assert'); | ||
| 5 | + const assert = require('node:assert'); | ||
| 6 | 6 | const { formatList } = require('internal/errors'); | |
| 7 | 7 | ||
| 8 | 8 | if (!common.hasIntl) common.skip('missing Intl'); | |
@@ -14,7 +14,7 @@ if (!common.hasIntl) common.skip('missing Intl'); | |||
| 14 | 14 | const input = ['apple', 'banana', 'orange', 'pear']; | |
| 15 | 15 | for (let i = 0; i < input.length; i++) { | |
| 16 | 16 | const slicedInput = input.slice(0, i); | |
| 17 | - strictEqual(formatList(slicedInput), and.format(slicedInput)); | ||
| 18 | - strictEqual(formatList(slicedInput, 'or'), or.format(slicedInput)); | ||
| 17 | + assert.strictEqual(formatList(slicedInput), and.format(slicedInput)); | ||
| 18 | + assert.strictEqual(formatList(slicedInput, 'or'), or.format(slicedInput)); | ||
| 19 | 19 | } | |
| 20 | 20 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ const fixtures = require('../common/fixtures'); | |||
| 28 | 28 | function errExec(script, option, callback) { | |
| 29 | 29 | callback = typeof option === 'function' ? option : callback; | |
| 30 | 30 | option = typeof option === 'string' ? option : ''; | |
| 31 | - return exec(...common.escapePOSIXShell`"${process.execPath}" ${option} "${fixtures.path(script)}"`, (err, stdout, stderr) => { | ||
| 31 | + return exec(...common.escapePOSIXShell`"${process.execPath}" ${option} "${fixtures.path(script)}"`, common.mustCall((err, stdout, stderr) => { | ||
| 32 | 32 | // There was some error | |
| 33 | 33 | assert.ok(err); | |
| 34 | 34 | ||
@@ -37,7 +37,7 @@ function errExec(script, option, callback) { | |||
| 37 | 37 | ||
| 38 | 38 | // Proxy the args for more tests. | |
| 39 | 39 | callback(err, stdout, stderr); | |
| 40 | - }); | ||
| 40 | + })); | ||
| 41 | 41 | } | |
| 42 | 42 | ||
| 43 | 43 | const syntaxErrorMessage = /\bSyntaxError\b/; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,211 +1,211 @@ | |||
| 1 | 1 | // Flags: --expose-internals | |
| 2 | 2 | ||
| 3 | 3 | import '../common/index.mjs'; | |
| 4 | - import { strictEqual } from 'node:assert'; | ||
| 4 | + import assert from 'node:assert'; | ||
| 5 | 5 | import errorsModule from 'internal/errors'; | |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | const { determineSpecificType } = errorsModule; | |
| 9 | 9 | ||
| 10 | - strictEqual( | ||
| 10 | + assert.strictEqual( | ||
| 11 | 11 | determineSpecificType(1n), | |
| 12 | 12 | 'type bigint (1n)', | |
| 13 | 13 | ); | |
| 14 | 14 | ||
| 15 | - strictEqual( | ||
| 15 | + assert.strictEqual( | ||
| 16 | 16 | determineSpecificType(true), | |
| 17 | 17 | 'type boolean (true)', | |
| 18 | 18 | ); | |
| 19 | - strictEqual( | ||
| 19 | + assert.strictEqual( | ||
| 20 | 20 | determineSpecificType(false), | |
| 21 | 21 | 'type boolean (false)', | |
| 22 | 22 | ); | |
| 23 | 23 | ||
| 24 | - strictEqual( | ||
| 24 | + assert.strictEqual( | ||
| 25 | 25 | determineSpecificType(2), | |
| 26 | 26 | 'type number (2)', | |
| 27 | 27 | ); | |
| 28 | 28 | ||
| 29 | - strictEqual( | ||
| 29 | + assert.strictEqual( | ||
| 30 | 30 | determineSpecificType(NaN), | |
| 31 | 31 | 'type number (NaN)', | |
| 32 | 32 | ); | |
| 33 | 33 | ||
| 34 | - strictEqual( | ||
| 34 | + assert.strictEqual( | ||
| 35 | 35 | determineSpecificType(Infinity), | |
| 36 | 36 | 'type number (Infinity)', | |
| 37 | 37 | ); | |
| 38 | 38 | ||
| 39 | - strictEqual( | ||
| 39 | + assert.strictEqual( | ||
| 40 | 40 | determineSpecificType({ __proto__: null }), | |
| 41 | 41 | '[Object: null prototype] {}', | |
| 42 | 42 | ); | |
| 43 | 43 | ||
| 44 | - strictEqual( | ||
| 44 | + assert.strictEqual( | ||
| 45 | 45 | determineSpecificType(''), | |
| 46 | 46 | "type string ('')", | |
| 47 | 47 | ); | |
| 48 | 48 | ||
| 49 | - strictEqual( | ||
| 49 | + assert.strictEqual( | ||
| 50 | 50 | determineSpecificType(''), | |
| 51 | 51 | "type string ('')", | |
| 52 | 52 | ); | |
| 53 | - strictEqual( | ||
| 53 | + assert.strictEqual( | ||
| 54 | 54 | determineSpecificType("''"), | |
| 55 | 55 | "type string (\"''\")", | |
| 56 | 56 | ); | |
| 57 | - strictEqual( | ||
| 57 | + assert.strictEqual( | ||
| 58 | 58 | determineSpecificType('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor'), | |
| 59 | 59 | "type string ('Lorem ipsum dolor sit ame...')", | |
| 60 | 60 | ); | |
| 61 | - strictEqual( | ||
| 61 | + assert.strictEqual( | ||
| 62 | 62 | determineSpecificType("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor'"), | |
| 63 | 63 | "type string ('Lorem ipsum dolor sit ame...')", | |
| 64 | 64 | ); | |
| 65 | - strictEqual( | ||
| 65 | + assert.strictEqual( | ||
| 66 | 66 | determineSpecificType("Lorem' ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"), | |
| 67 | 67 | "type string (\"Lorem' ipsum dolor sit am...\")", | |
| 68 | 68 | ); | |
| 69 | 69 | ||
| 70 | - strictEqual( | ||
| 70 | + assert.strictEqual( | ||
| 71 | 71 | determineSpecificType(Symbol('foo')), | |
| 72 | 72 | 'type symbol (Symbol(foo))', | |
| 73 | 73 | ); | |
| 74 | 74 | ||
| 75 | - strictEqual( | ||
| 75 | + assert.strictEqual( | ||
| 76 | 76 | determineSpecificType(function foo() {}), | |
| 77 | 77 | 'function foo', | |
| 78 | 78 | ); | |
| 79 | 79 | ||
| 80 | 80 | const implicitlyNamed = function() {}; // eslint-disable-line func-style | |
| 81 | - strictEqual( | ||
| 81 | + assert.strictEqual( | ||
| 82 | 82 | determineSpecificType(implicitlyNamed), | |
| 83 | 83 | 'function implicitlyNamed', | |
| 84 | 84 | ); | |
| 85 | - strictEqual( | ||
| 85 | + assert.strictEqual( | ||
| 86 | 86 | determineSpecificType(() => {}), | |
| 87 | 87 | 'function ', | |
| 88 | 88 | ); | |
| 89 | 89 | function noName() {} | |
| 90 | 90 | delete noName.name; | |
| 91 | - strictEqual( | ||
| 91 | + assert.strictEqual( | ||
| 92 | 92 | noName.name, | |
| 93 | 93 | '', | |
| 94 | 94 | ); | |
| 95 | - strictEqual( | ||
| 95 | + assert.strictEqual( | ||
| 96 | 96 | determineSpecificType(noName), | |
| 97 | 97 | 'function ', | |
| 98 | 98 | ); | |
| 99 | 99 | ||
| 100 | 100 | function * generatorFn() {} | |
| 101 | - strictEqual( | ||
| 101 | + assert.strictEqual( | ||
| 102 | 102 | determineSpecificType(generatorFn), | |
| 103 | 103 | 'function generatorFn', | |
| 104 | 104 | ); | |
| 105 | 105 | ||
| 106 | 106 | async function asyncFn() {} | |
| 107 | - strictEqual( | ||
| 107 | + assert.strictEqual( | ||
| 108 | 108 | determineSpecificType(asyncFn), | |
| 109 | 109 | 'function asyncFn', | |
| 110 | 110 | ); | |
| 111 | 111 | ||
| 112 | - strictEqual( | ||
| 112 | + assert.strictEqual( | ||
| 113 | 113 | determineSpecificType(null), | |
| 114 | 114 | 'null', | |
| 115 | 115 | ); | |
| 116 | 116 | ||
| 117 | - strictEqual( | ||
| 117 | + assert.strictEqual( | ||
| 118 | 118 | determineSpecificType(undefined), | |
| 119 | 119 | 'undefined', | |
| 120 | 120 | ); | |
| 121 | 121 | ||
| 122 | - strictEqual( | ||
| 122 | + assert.strictEqual( | ||
| 123 | 123 | determineSpecificType([]), | |
| 124 | 124 | 'an instance of Array', | |
| 125 | 125 | ); | |
| 126 | 126 | ||
| 127 | - strictEqual( | ||
| 127 | + assert.strictEqual( | ||
| 128 | 128 | determineSpecificType(new Array()), | |
| 129 | 129 | 'an instance of Array', | |
| 130 | 130 | ); | |
| 131 | - strictEqual( | ||
| 131 | + assert.strictEqual( | ||
| 132 | 132 | determineSpecificType(new BigInt64Array()), | |
| 133 | 133 | 'an instance of BigInt64Array', | |
| 134 | 134 | ); | |
| 135 | - strictEqual( | ||
| 135 | + assert.strictEqual( | ||
| 136 | 136 | determineSpecificType(new BigUint64Array()), | |
| 137 | 137 | 'an instance of BigUint64Array', | |
| 138 | 138 | ); | |
| 139 | - strictEqual( | ||
| 139 | + assert.strictEqual( | ||
| 140 | 140 | determineSpecificType(new Int8Array()), | |
| 141 | 141 | 'an instance of Int8Array', | |
| 142 | 142 | ); | |
| 143 | - strictEqual( | ||
| 143 | + assert.strictEqual( | ||
| 144 | 144 | determineSpecificType(new Int16Array()), | |
| 145 | 145 | 'an instance of Int16Array', | |
| 146 | 146 | ); | |
| 147 | - strictEqual( | ||
| 147 | + assert.strictEqual( | ||
| 148 | 148 | determineSpecificType(new Int32Array()), | |
| 149 | 149 | 'an instance of Int32Array', | |
| 150 | 150 | ); | |
| 151 | - strictEqual( | ||
| 151 | + assert.strictEqual( | ||
| 152 | 152 | determineSpecificType(new Float32Array()), | |
| 153 | 153 | 'an instance of Float32Array', | |
| 154 | 154 | ); | |
| 155 | - strictEqual( | ||
| 155 | + assert.strictEqual( | ||
| 156 | 156 | determineSpecificType(new Float64Array()), | |
| 157 | 157 | 'an instance of Float64Array', | |
| 158 | 158 | ); | |
| 159 | - strictEqual( | ||
| 159 | + assert.strictEqual( | ||
| 160 | 160 | determineSpecificType(new Uint8Array()), | |
| 161 | 161 | 'an instance of Uint8Array', | |
| 162 | 162 | ); | |
| 163 | - strictEqual( | ||
| 163 | + assert.strictEqual( | ||
| 164 | 164 | determineSpecificType(new Uint8ClampedArray()), | |
| 165 | 165 | 'an instance of Uint8ClampedArray', | |
| 166 | 166 | ); | |
| 167 | - strictEqual( | ||
| 167 | + assert.strictEqual( | ||
| 168 | 168 | determineSpecificType(new Uint16Array()), | |
| 169 | 169 | 'an instance of Uint16Array', | |
| 170 | 170 | ); | |
| 171 | - strictEqual( | ||
| 171 | + assert.strictEqual( | ||
| 172 | 172 | determineSpecificType(new Uint32Array()), | |
| 173 | 173 | 'an instance of Uint32Array', | |
| 174 | 174 | ); | |
| 175 | 175 | ||
| 176 | - strictEqual( | ||
| 176 | + assert.strictEqual( | ||
| 177 | 177 | determineSpecificType(new Date()), | |
| 178 | 178 | 'an instance of Date', | |
| 179 | 179 | ); | |
| 180 | 180 | ||
| 181 | - strictEqual( | ||
| 181 | + assert.strictEqual( | ||
| 182 | 182 | determineSpecificType(new Map()), | |
| 183 | 183 | 'an instance of Map', | |
| 184 | 184 | ); | |
| 185 | - strictEqual( | ||
| 185 | + assert.strictEqual( | ||
| 186 | 186 | determineSpecificType(new WeakMap()), | |
| 187 | 187 | 'an instance of WeakMap', | |
| 188 | 188 | ); | |
| 189 | 189 | ||
| 190 | - strictEqual( | ||
| 190 | + assert.strictEqual( | ||
| 191 | 191 | determineSpecificType({}), | |
| 192 | 192 | 'an instance of Object', | |
| 193 | 193 | ); | |
| 194 | - strictEqual( | ||
| 194 | + assert.strictEqual( | ||
| 195 | 195 | determineSpecificType(new Object()), | |
| 196 | 196 | 'an instance of Object', | |
| 197 | 197 | ); | |
| 198 | 198 | ||
| 199 | - strictEqual( | ||
| 199 | + assert.strictEqual( | ||
| 200 | 200 | determineSpecificType(Promise.resolve('foo')), | |
| 201 | 201 | 'an instance of Promise', | |
| 202 | 202 | ); | |
| 203 | 203 | ||
| 204 | - strictEqual( | ||
| 204 | + assert.strictEqual( | ||
| 205 | 205 | determineSpecificType(new Set()), | |
| 206 | 206 | 'an instance of Set', | |
| 207 | 207 | ); | |
| 208 | - strictEqual( | ||
| 208 | + assert.strictEqual( | ||
| 209 | 209 | determineSpecificType(new WeakSet()), | |
| 210 | 210 | 'an instance of WeakSet', | |
| 211 | 211 | ); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,30 +2,27 @@ | |||
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | 4 | require('../common'); | |
| 5 | - const { | ||
| 6 | - strictEqual, | ||
| 7 | - throws, | ||
| 8 | - } = require('assert'); | ||
| 5 | + const assert = require('assert'); | ||
| 9 | 6 | const { AbortError } = require('internal/errors'); | |
| 10 | 7 | ||
| 11 | 8 | { | |
| 12 | 9 | const err = new AbortError(); | |
| 13 | - strictEqual(err.message, 'The operation was aborted'); | ||
| 14 | - strictEqual(err.cause, undefined); | ||
| 10 | + assert.strictEqual(err.message, 'The operation was aborted'); | ||
| 11 | + assert.strictEqual(err.cause, undefined); | ||
| 15 | 12 | } | |
| 16 | 13 | ||
| 17 | 14 | { | |
| 18 | 15 | const cause = new Error('boom'); | |
| 19 | 16 | const err = new AbortError('bang', { cause }); | |
| 20 | - strictEqual(err.message, 'bang'); | ||
| 21 | - strictEqual(err.cause, cause); | ||
| 17 | + assert.strictEqual(err.message, 'bang'); | ||
| 18 | + assert.strictEqual(err.cause, cause); | ||
| 22 | 19 | } | |
| 23 | 20 | ||
| 24 | 21 | { | |
| 25 | - throws(() => new AbortError('', false), { | ||
| 22 | + assert.throws(() => new AbortError('', false), { | ||
| 26 | 23 | code: 'ERR_INVALID_ARG_TYPE' | |
| 27 | 24 | }); | |
| 28 | - throws(() => new AbortError('', ''), { | ||
| 25 | + assert.throws(() => new AbortError('', ''), { | ||
| 29 | 26 | code: 'ERR_INVALID_ARG_TYPE' | |
| 30 | 27 | }); | |
| 31 | 28 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | // Flags: --expose-internals | |
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | - require('../common'); | ||
| 4 | + const common = require('../common'); | ||
| 5 | 5 | const { hideStackFrames, codes } = require('internal/errors'); | |
| 6 | 6 | const { validateInteger } = require('internal/validators'); | |
| 7 | 7 | const assert = require('assert'); | |
@@ -209,19 +209,15 @@ const assert = require('assert'); | |||
| 209 | 209 | ||
| 210 | 210 | { | |
| 211 | 211 | // Binding passes the value of this to the wrapped function. | |
| 212 | - let called = false; | ||
| 213 | 212 | function a() { | |
| 214 | 213 | b.bind({ key: 'value' })(); | |
| 215 | 214 | } | |
| 216 | 215 | ||
| 217 | - const b = hideStackFrames(function b() { | ||
| 216 | + const b = hideStackFrames(common.mustCall(function b() { | ||
| 218 | 217 | assert.strictEqual(this.key, 'value'); | |
| 219 | - called = true; | ||
| 220 | - }); | ||
| 218 | + })); | ||
| 221 | 219 | ||
| 222 | 220 | a(); | |
| 223 | - | ||
| 224 | - assert.strictEqual(called, true); | ||
| 225 | 221 | } | |
| 226 | 222 | ||
| 227 | 223 | { | |
@@ -231,10 +227,10 @@ const assert = require('assert'); | |||
| 231 | 227 | b.withoutStackTrace.bind({ key: 'value' })(); | |
| 232 | 228 | } | |
| 233 | 229 | ||
| 234 | - const b = hideStackFrames(function b() { | ||
| 230 | + const b = hideStackFrames(common.mustCall(function b() { | ||
| 235 | 231 | assert.strictEqual(this.key, 'value'); | |
| 236 | 232 | called = true; | |
| 237 | - }); | ||
| 233 | + })); | ||
| 238 | 234 | ||
| 239 | 235 | a(); | |
| 240 | 236 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments