GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: add subtests to test-node-run · nodejs/node@6bcbfcd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • fixtures/run-script
      • cannot-find-script
        • package.json
      • cannot-parse
        • package.json
    • parallel
      • test-node-run.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/fixtures/run-script/cannot-find-script/package.json‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"types" : ""
3+
}
Collapse file

‎test/fixtures/run-script/cannot-parse/package.json‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "non-parsable package.json"
Collapse file

‎test/parallel/test-node-run.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-node-run.js
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,26 @@ describe('node --run [command]', () => {
113113
assert.strictEqual(child.stderr, '');
114114
assert.strictEqual(child.code, 0);
115115
});
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+
});
116138
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.