| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a5a320c commit 6bcbfcd
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + { | ||
| 2 | + "types" : "" | ||
| 3 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + { "non-parsable package.json" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,4 +113,26 @@ describe('node --run [command]', () => { | |||
| 113 | 113 | assert.strictEqual(child.stderr, ''); | |
| 114 | 114 | assert.strictEqual(child.code, 0); | |
| 115 | 115 | }); | |
| 116 | + | ||
| 117 | + it('returns error on unparsable file', async () => { | ||
| 118 | + const child = await common.spawnPromisified( | ||
| 119 | + process.execPath, | ||
| 120 | + [ '--no-warnings', '--run', 'test'], | ||
| 121 | + { cwd: fixtures.path('run-script/cannot-parse') }, | ||
| 122 | + ); | ||
| 123 | + assert.match(child.stderr, /Can't parse package\.json/); | ||
| 124 | + assert.strictEqual(child.stdout, ''); | ||
| 125 | + assert.strictEqual(child.code, 1); | ||
| 126 | + }); | ||
| 127 | + | ||
| 128 | + it('returns error when there is no "scripts" field file', async () => { | ||
| 129 | + const child = await common.spawnPromisified( | ||
| 130 | + process.execPath, | ||
| 131 | + [ '--no-warnings', '--run', 'test'], | ||
| 132 | + { cwd: fixtures.path('run-script/cannot-find-script') }, | ||
| 133 | + ); | ||
| 134 | + assert.match(child.stderr, /Can't find "scripts" field in package\.json/); | ||
| 135 | + assert.strictEqual(child.stdout, ''); | ||
| 136 | + assert.strictEqual(child.code, 1); | ||
| 137 | + }); | ||
| 116 | 138 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments