Skip to content

Commit

Permalink
fix(tests): be a bit more lenient with NPM warn output
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed May 27, 2024
1 parent 4833980 commit 7859ec6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/cdktf-cli/src/test/cmds/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ describe("init command", () => {
input,
}
);
expect(result.stderr).toEqual("");
// we expect either empty error output or every line beginning with "npm WARN"
if (result.stderr.length > 0) {
const lines = result.stderr.split("\n");
for (const line of lines) {
expect(line).toContain("npm WARN");
}
} else {
expect(result.stderr).toEqual("");
}

expect(result.stdout).not.toContain(
`opening webpage using your browser.`
);
Expand Down

0 comments on commit 7859ec6

Please sign in to comment.