Skip to content

Commit 949138c

Browse files
committed
fix(ci): correctly report packages spec failures
1 parent a9f9976 commit 949138c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build": "node ./scripts/publish/build.js",
1313
"build:patch": "node ./scripts/patch.js",
1414
"build:packages": "for PKG in packages/*; do echo Building $PKG...; tsc -p $PKG; done",
15-
"test": "npm run test:packages && npm run test:cli",
15+
"test": "npm-run-all -c test:packages test:cli",
1616
"e2e": "npm run test:e2e",
1717
"e2e:nightly": "node tests/e2e_runner.js --nightly",
1818
"mobile_test": "mocha tests/e2e/e2e_workflow.spec.js",

packages/ast-tools/src/route-utils.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export default [\n { path: 'new-route', component: NewRouteComponent }\n];`);
293293
`\nexport default [\n` +
294294
` { path: 'home', component: HomeComponent,\n` +
295295
` children: [\n` +
296-
` { path: 'about/:id', component: AboutComponent } ` +
296+
` { path: 'about/:id', component: AboutComponent }` +
297297
`\n ]\n }\n];`);
298298
});
299299
});

packages/ast-tools/src/route-utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ function addChildPath (parentObject: ts.Node, pathOptions: any, route: string) {
416416
if (childrenNode.length !== 0) {
417417
// add to beginning of children array
418418
pos = childrenNode[0].getChildAt(2).getChildAt(1).pos; // open bracket
419-
newContent = `\n${spaces}${content}, `;
419+
newContent = `\n${spaces}${content},`;
420420
} else {
421421
// no children array, add one
422422
pos = parentObject.getChildAt(2).pos; // close brace
423-
newContent = `,\n${spaces.substring(2)}children: [\n${spaces}${content} ` +
423+
newContent = `,\n${spaces.substring(2)}children: [\n${spaces}${content}` +
424424
`\n${spaces.substring(2)}]\n${spaces.substring(5)}`;
425425
}
426426
return {newContent: newContent, pos: pos};

scripts/run-packages-spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const projectBaseDir = path.join(__dirname, '../packages');
1414
const jasmine = new Jasmine({ projectBaseDir: projectBaseDir });
1515
jasmine.loadConfig({});
1616
jasmine.addReporter(new JasmineSpecReporter());
17+
// Manually set exit code (needed with custom reporters)
18+
jasmine.onComplete((success) => process.exitCode = !success);
1719

1820
// Run the tests.
1921
const allTests =

0 commit comments

Comments
 (0)