| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + { | ||
| 2 | + "nodeOptions": { | ||
| 3 | + "inspect-port | ||
| 4 | + } | ||
| 5 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + { | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + { | ||
| 2 | + "nodeOptions": "string" | ||
| 3 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + [] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -254,3 +254,53 @@ test('should not allow users to sneak in a flag', async () => { | |||
| 254 | 254 | strictEqual(result.stdout, ''); | |
| 255 | 255 | strictEqual(result.code, 9); | |
| 256 | 256 | }); | |
| 257 | + | ||
| 258 | + test('non object root', async () => { | ||
| 259 | + const result = await spawnPromisified(process.execPath, [ | ||
| 260 | + '--no-warnings', | ||
| 261 | + '--experimental-config-file', | ||
| 262 | + fixtures.path('rc/non-object-root.json'), | ||
| 263 | + '-p', '"Hello, World!"', | ||
| 264 | + ]); | ||
| 265 | + match(result.stderr, /Root value unexpected not an object for/); | ||
| 266 | + strictEqual(result.stdout, ''); | ||
| 267 | + strictEqual(result.code, 9); | ||
| 268 | + }); | ||
| 269 | + | ||
| 270 | + test('non object node options', async () => { | ||
| 271 | + const result = await spawnPromisified(process.execPath, [ | ||
| 272 | + '--no-warnings', | ||
| 273 | + '--experimental-config-file', | ||
| 274 | + fixtures.path('rc/non-object-node-options.json'), | ||
| 275 | + '-p', '"Hello, World!"', | ||
| 276 | + ]); | ||
| 277 | + match(result.stderr, /"nodeOptions" value unexpected for/); | ||
| 278 | + strictEqual(result.stdout, ''); | ||
| 279 | + strictEqual(result.code, 9); | ||
| 280 | + }); | ||
| 281 | + | ||
| 282 | + test('should throw correct error when a json is broken', async () => { | ||
| 283 | + const result = await spawnPromisified(process.execPath, [ | ||
| 284 | + '--no-warnings', | ||
| 285 | + '--experimental-config-file', | ||
| 286 | + fixtures.path('rc/broken.json'), | ||
| 287 | + '-p', '"Hello, World!"', | ||
| 288 | + ]); | ||
| 289 | + match(result.stderr, /Can't parse/); | ||
| 290 | + match(result.stderr, /broken\.json: invalid content/); | ||
| 291 | + strictEqual(result.stdout, ''); | ||
| 292 | + strictEqual(result.code, 9); | ||
| 293 | + }); | ||
| 294 | + | ||
| 295 | + test('broken value in node_options', async () => { | ||
| 296 | + const result = await spawnPromisified(process.execPath, [ | ||
| 297 | + '--no-warnings', | ||
| 298 | + '--experimental-config-file', | ||
| 299 | + fixtures.path('rc/broken-node-options.json'), | ||
| 300 | + '-p', '"Hello, World!"', | ||
| 301 | + ]); | ||
| 302 | + match(result.stderr, /Can't parse/); | ||
| 303 | + match(result.stderr, /broken-node-options\.json: invalid content/); | ||
| 304 | + strictEqual(result.stdout, ''); | ||
| 305 | + strictEqual(result.code, 9); | ||
| 306 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments