@@ -18,56 +18,56 @@ const { |
18 | 18 |
|
19 | 19 | throws(() => exec(`${process.execPath} ${__filename} AAA BBB\0XXX CCC`, mustNotCall()), { |
20 | 20 | code: 'ERR_INVALID_ARG_VALUE', |
21 | | - message: /The argument 'command' must be a string without null bytes/ |
| 21 | + name: 'TypeError', |
22 | 22 | }); |
23 | 23 |
|
24 | 24 | throws(() => exec('BBB\0XXX AAA CCC', mustNotCall()), { |
25 | 25 | code: 'ERR_INVALID_ARG_VALUE', |
26 | | - message: /The argument 'command' must be a string without null bytes/ |
| 26 | + name: 'TypeError', |
27 | 27 | }); |
28 | 28 |
|
29 | 29 | throws(() => execSync(`${process.execPath} ${__filename} AAA BBB\0XXX CCC`), { |
30 | 30 | code: 'ERR_INVALID_ARG_VALUE', |
31 | | - message: /The argument 'command' must be a string without null bytes/ |
| 31 | + name: 'TypeError', |
32 | 32 | }); |
33 | 33 |
|
34 | 34 | throws(() => execSync('BBB\0XXX AAA CCC'), { |
35 | 35 | code: 'ERR_INVALID_ARG_VALUE', |
36 | | - message: /The argument 'command' must be a string without null bytes/ |
| 36 | + name: 'TypeError', |
37 | 37 | }); |
38 | 38 |
|
39 | 39 | // Tests for the 'file' argument |
40 | 40 |
|
41 | 41 | throws(() => spawn('BBB\0XXX'), { |
42 | 42 | code: 'ERR_INVALID_ARG_VALUE', |
43 | | - message: /The argument 'file' must be a string without null bytes/ |
| 43 | + name: 'TypeError', |
44 | 44 | }); |
45 | 45 |
|
46 | 46 | throws(() => execFile('BBB\0XXX', mustNotCall()), { |
47 | 47 | code: 'ERR_INVALID_ARG_VALUE', |
48 | | - message: /The argument 'file' must be a string without null bytes/ |
| 48 | + name: 'TypeError', |
49 | 49 | }); |
50 | 50 |
|
51 | 51 | throws(() => execFileSync('BBB\0XXX'), { |
52 | 52 | code: 'ERR_INVALID_ARG_VALUE', |
53 | | - message: /The argument 'file' must be a string without null bytes/ |
| 53 | + name: 'TypeError', |
54 | 54 | }); |
55 | 55 |
|
56 | 56 | throws(() => spawn('BBB\0XXX'), { |
57 | 57 | code: 'ERR_INVALID_ARG_VALUE', |
58 | | - message: /The argument 'file' must be a string without null bytes/ |
| 58 | + name: 'TypeError', |
59 | 59 | }); |
60 | 60 |
|
61 | 61 | throws(() => spawnSync('BBB\0XXX'), { |
62 | 62 | code: 'ERR_INVALID_ARG_VALUE', |
63 | | - message: /The argument 'file' must be a string without null bytes/ |
| 63 | + name: 'TypeError', |
64 | 64 | }); |
65 | 65 |
|
66 | 66 | // Tests for the 'modulePath' argument |
67 | 67 |
|
68 | 68 | throws(() => fork('BBB\0XXX'), { |
69 | 69 | code: 'ERR_INVALID_ARG_VALUE', |
70 | | - message: /The argument 'modulePath' must be a string or Uint8Array without null bytes/ |
| 70 | + name: 'TypeError', |
71 | 71 | }); |
72 | 72 |
|
73 | 73 | // Tests for the 'args' argument |
@@ -77,218 +77,218 @@ throws(() => fork('BBB\0XXX'), { |
77 | 77 |
|
78 | 78 | throws(() => execFile(process.execPath, [__filename, 'AAA', 'BBB\0XXX', 'CCC'], mustNotCall()), { |
79 | 79 | code: 'ERR_INVALID_ARG_VALUE', |
80 | | - message: /The argument 'args\[2\]' must be a string without null bytes/ |
| 80 | + name: 'TypeError', |
81 | 81 | }); |
82 | 82 |
|
83 | 83 | throws(() => execFileSync(process.execPath, [__filename, 'AAA', 'BBB\0XXX', 'CCC']), { |
84 | 84 | code: 'ERR_INVALID_ARG_VALUE', |
85 | | - message: /The argument 'args\[2\]' must be a string without null bytes/ |
| 85 | + name: 'TypeError', |
86 | 86 | }); |
87 | 87 |
|
88 | 88 | throws(() => fork(__filename, ['AAA', 'BBB\0XXX', 'CCC']), { |
89 | 89 | code: 'ERR_INVALID_ARG_VALUE', |
90 | | - message: /The argument 'args\[2\]' must be a string without null bytes/ |
| 90 | + name: 'TypeError', |
91 | 91 | }); |
92 | 92 |
|
93 | 93 | throws(() => spawn(process.execPath, [__filename, 'AAA', 'BBB\0XXX', 'CCC']), { |
94 | 94 | code: 'ERR_INVALID_ARG_VALUE', |
95 | | - message: /The argument 'args\[2\]' must be a string without null bytes/ |
| 95 | + name: 'TypeError', |
96 | 96 | }); |
97 | 97 |
|
98 | 98 | throws(() => spawnSync(process.execPath, [__filename, 'AAA', 'BBB\0XXX', 'CCC']), { |
99 | 99 | code: 'ERR_INVALID_ARG_VALUE', |
100 | | - message: /The argument 'args\[2\]' must be a string without null bytes/ |
| 100 | + name: 'TypeError', |
101 | 101 | }); |
102 | 102 |
|
103 | 103 | // Tests for the 'options.cwd' argument |
104 | 104 |
|
105 | 105 | throws(() => exec(process.execPath, { cwd: 'BBB\0XXX' }, mustNotCall()), { |
106 | 106 | code: 'ERR_INVALID_ARG_VALUE', |
107 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 107 | + name: 'TypeError', |
108 | 108 | }); |
109 | 109 |
|
110 | 110 | throws(() => execFile(process.execPath, { cwd: 'BBB\0XXX' }, mustNotCall()), { |
111 | 111 | code: 'ERR_INVALID_ARG_VALUE', |
112 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 112 | + name: 'TypeError', |
113 | 113 | }); |
114 | 114 |
|
115 | 115 | throws(() => execFileSync(process.execPath, { cwd: 'BBB\0XXX' }), { |
116 | 116 | code: 'ERR_INVALID_ARG_VALUE', |
117 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 117 | + name: 'TypeError', |
118 | 118 | }); |
119 | 119 |
|
120 | 120 | throws(() => execSync(process.execPath, { cwd: 'BBB\0XXX' }), { |
121 | 121 | code: 'ERR_INVALID_ARG_VALUE', |
122 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 122 | + name: 'TypeError', |
123 | 123 | }); |
124 | 124 |
|
125 | 125 | throws(() => fork(__filename, { cwd: 'BBB\0XXX' }), { |
126 | 126 | code: 'ERR_INVALID_ARG_VALUE', |
127 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 127 | + name: 'TypeError', |
128 | 128 | }); |
129 | 129 |
|
130 | 130 | throws(() => spawn(process.execPath, { cwd: 'BBB\0XXX' }), { |
131 | 131 | code: 'ERR_INVALID_ARG_VALUE', |
132 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 132 | + name: 'TypeError', |
133 | 133 | }); |
134 | 134 |
|
135 | 135 | throws(() => spawnSync(process.execPath, { cwd: 'BBB\0XXX' }), { |
136 | 136 | code: 'ERR_INVALID_ARG_VALUE', |
137 | | - message: /The property 'options\.cwd' must be a string or Uint8Array without null bytes/ |
| 137 | + name: 'TypeError', |
138 | 138 | }); |
139 | 139 |
|
140 | 140 | // Tests for the 'options.argv0' argument |
141 | 141 |
|
142 | 142 | throws(() => exec(process.execPath, { argv0: 'BBB\0XXX' }, mustNotCall()), { |
143 | 143 | code: 'ERR_INVALID_ARG_VALUE', |
144 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 144 | + name: 'TypeError', |
145 | 145 | }); |
146 | 146 |
|
147 | 147 | throws(() => execFile(process.execPath, { argv0: 'BBB\0XXX' }, mustNotCall()), { |
148 | 148 | code: 'ERR_INVALID_ARG_VALUE', |
149 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 149 | + name: 'TypeError', |
150 | 150 | }); |
151 | 151 |
|
152 | 152 | throws(() => execFileSync(process.execPath, { argv0: 'BBB\0XXX' }), { |
153 | 153 | code: 'ERR_INVALID_ARG_VALUE', |
154 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 154 | + name: 'TypeError', |
155 | 155 | }); |
156 | 156 |
|
157 | 157 | throws(() => execSync(process.execPath, { argv0: 'BBB\0XXX' }), { |
158 | 158 | code: 'ERR_INVALID_ARG_VALUE', |
159 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 159 | + name: 'TypeError', |
160 | 160 | }); |
161 | 161 |
|
162 | 162 | throws(() => fork(__filename, { argv0: 'BBB\0XXX' }), { |
163 | 163 | code: 'ERR_INVALID_ARG_VALUE', |
164 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 164 | + name: 'TypeError', |
165 | 165 | }); |
166 | 166 |
|
167 | 167 | throws(() => spawn(process.execPath, { argv0: 'BBB\0XXX' }), { |
168 | 168 | code: 'ERR_INVALID_ARG_VALUE', |
169 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 169 | + name: 'TypeError', |
170 | 170 | }); |
171 | 171 |
|
172 | 172 | throws(() => spawnSync(process.execPath, { argv0: 'BBB\0XXX' }), { |
173 | 173 | code: 'ERR_INVALID_ARG_VALUE', |
174 | | - message: /The property 'options\.argv0' must be a string without null bytes/ |
| 174 | + name: 'TypeError', |
175 | 175 | }); |
176 | 176 |
|
177 | 177 | // Tests for the 'options.shell' argument |
178 | 178 |
|
179 | 179 | throws(() => exec(process.execPath, { shell: 'BBB\0XXX' }, mustNotCall()), { |
180 | 180 | code: 'ERR_INVALID_ARG_VALUE', |
181 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 181 | + name: 'TypeError', |
182 | 182 | }); |
183 | 183 |
|
184 | 184 | throws(() => execFile(process.execPath, { shell: 'BBB\0XXX' }, mustNotCall()), { |
185 | 185 | code: 'ERR_INVALID_ARG_VALUE', |
186 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 186 | + name: 'TypeError', |
187 | 187 | }); |
188 | 188 |
|
189 | 189 | throws(() => execFileSync(process.execPath, { shell: 'BBB\0XXX' }), { |
190 | 190 | code: 'ERR_INVALID_ARG_VALUE', |
191 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 191 | + name: 'TypeError', |
192 | 192 | }); |
193 | 193 |
|
194 | 194 | throws(() => execSync(process.execPath, { shell: 'BBB\0XXX' }), { |
195 | 195 | code: 'ERR_INVALID_ARG_VALUE', |
196 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 196 | + name: 'TypeError', |
197 | 197 | }); |
198 | 198 |
|
199 | 199 | // Not testing fork() because it doesn't accept the shell option (internally it |
200 | 200 | // explicitly sets shell to false). |
201 | 201 |
|
202 | 202 | throws(() => spawn(process.execPath, { shell: 'BBB\0XXX' }), { |
203 | 203 | code: 'ERR_INVALID_ARG_VALUE', |
204 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 204 | + name: 'TypeError', |
205 | 205 | }); |
206 | 206 |
|
207 | 207 | throws(() => spawnSync(process.execPath, { shell: 'BBB\0XXX' }), { |
208 | 208 | code: 'ERR_INVALID_ARG_VALUE', |
209 | | - message: /The property 'options\.shell' must be a string without null bytes/ |
| 209 | + name: 'TypeError', |
210 | 210 | }); |
211 | 211 |
|
212 | 212 | // Tests for the 'options.env' argument |
213 | 213 |
|
214 | 214 | throws(() => exec(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }, mustNotCall()), { |
215 | 215 | code: 'ERR_INVALID_ARG_VALUE', |
216 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 216 | + name: 'TypeError', |
217 | 217 | }); |
218 | 218 |
|
219 | 219 | throws(() => exec(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }, mustNotCall()), { |
220 | 220 | code: 'ERR_INVALID_ARG_VALUE', |
221 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 221 | + name: 'TypeError', |
222 | 222 | }); |
223 | 223 |
|
224 | 224 | throws(() => execFile(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }, mustNotCall()), { |
225 | 225 | code: 'ERR_INVALID_ARG_VALUE', |
226 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 226 | + name: 'TypeError', |
227 | 227 | }); |
228 | 228 |
|
229 | 229 | throws(() => execFile(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }, mustNotCall()), { |
230 | 230 | code: 'ERR_INVALID_ARG_VALUE', |
231 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 231 | + name: 'TypeError', |
232 | 232 | }); |
233 | 233 |
|
234 | 234 | throws(() => execFileSync(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }), { |
235 | 235 | code: 'ERR_INVALID_ARG_VALUE', |
236 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 236 | + name: 'TypeError', |
237 | 237 | }); |
238 | 238 |
|
239 | 239 | throws(() => execFileSync(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }), { |
240 | 240 | code: 'ERR_INVALID_ARG_VALUE', |
241 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 241 | + name: 'TypeError', |
242 | 242 | }); |
243 | 243 |
|
244 | 244 | throws(() => execSync(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }), { |
245 | 245 | code: 'ERR_INVALID_ARG_VALUE', |
246 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 246 | + name: 'TypeError', |
247 | 247 | }); |
248 | 248 |
|
249 | 249 | throws(() => execSync(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }), { |
250 | 250 | code: 'ERR_INVALID_ARG_VALUE', |
251 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 251 | + name: 'TypeError', |
252 | 252 | }); |
253 | 253 |
|
254 | 254 | throws(() => fork(__filename, { env: { 'AAA': 'BBB\0XXX' } }), { |
255 | 255 | code: 'ERR_INVALID_ARG_VALUE', |
256 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 256 | + name: 'TypeError', |
257 | 257 | }); |
258 | 258 |
|
259 | 259 | throws(() => fork(__filename, { env: { 'BBB\0XXX': 'AAA' } }), { |
260 | 260 | code: 'ERR_INVALID_ARG_VALUE', |
261 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 261 | + name: 'TypeError', |
262 | 262 | }); |
263 | 263 |
|
264 | 264 | throws(() => spawn(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }), { |
265 | 265 | code: 'ERR_INVALID_ARG_VALUE', |
266 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 266 | + name: 'TypeError', |
267 | 267 | }); |
268 | 268 |
|
269 | 269 | throws(() => spawn(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }), { |
270 | 270 | code: 'ERR_INVALID_ARG_VALUE', |
271 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 271 | + name: 'TypeError', |
272 | 272 | }); |
273 | 273 |
|
274 | 274 | throws(() => spawnSync(process.execPath, { env: { 'AAA': 'BBB\0XXX' } }), { |
275 | 275 | code: 'ERR_INVALID_ARG_VALUE', |
276 | | - message: /The property 'options\.env\['AAA'\]' must be a string without null bytes/ |
| 276 | + name: 'TypeError', |
277 | 277 | }); |
278 | 278 |
|
279 | 279 | throws(() => spawnSync(process.execPath, { env: { 'BBB\0XXX': 'AAA' } }), { |
280 | 280 | code: 'ERR_INVALID_ARG_VALUE', |
281 | | - message: /The property 'options\.env\['BBB\0XXX'\]' must be a string without null bytes/ |
| 281 | + name: 'TypeError', |
282 | 282 | }); |
283 | 283 |
|
284 | 284 | // Tests for the 'options.execPath' argument |
285 | 285 | throws(() => fork(__filename, { execPath: 'BBB\0XXX' }), { |
286 | 286 | code: 'ERR_INVALID_ARG_VALUE', |
287 | | - message: /The property 'options\.execPath' must be a string without null bytes/ |
| 287 | + name: 'TypeError', |
288 | 288 | }); |
289 | 289 |
|
290 | 290 | // Tests for the 'options.execArgv' argument |
291 | 291 | throws(() => fork(__filename, { execArgv: ['AAA', 'BBB\0XXX', 'CCC'] }), { |
292 | 292 | code: 'ERR_INVALID_ARG_VALUE', |
293 | | - message: /The property 'options\.execArgv\[1\]' must be a string without null bytes/ |
| 293 | + name: 'TypeError', |
294 | 294 | }); |