Skip to content

Commit

Permalink
test: do not use snapshots for error verification in e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-stepanenko committed Oct 29, 2023
1 parent 2b2c01f commit 31e3d91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 68 deletions.
33 changes: 0 additions & 33 deletions e2e/qwik-nx-e2e/tests/__snapshots__/application.spec.ts.snap

This file was deleted.

33 changes: 0 additions & 33 deletions e2e/qwik-nx-e2e/tests/__snapshots__/preset.spec.ts.snap

This file was deleted.

12 changes: 10 additions & 2 deletions e2e/qwik-nx-e2e/tests/application-basic-behavior.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
.replace(/-p .+/, '-p REPLACED_PATH/tsconfig.app.json');
}

expect(replaceDynamicContent(result.stderr)).toMatchSnapshot('stderr');
expect(replaceDynamicContent(result.stdout)).toMatchSnapshot('stdout');
const stdout = replaceDynamicContent(stripConsoleColors(result.stdout));
expect(stdout).toContain(
`PROJECT_NAME/src/routes/index.tsx:8:15 - error TS2322: Type 'string' is not assignable to type 'number'.`
);
expect(stdout).toContain(
`LIB_PROJECT_NAME/src/lib/LIB_PROJECT_NAME.tsx:7:22 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.`
);
expect(stdout).toContain(
`Running target build for project PROJECT_NAME failed`
);
},
DEFAULT_E2E_TIMEOUT
);
Expand Down

0 comments on commit 31e3d91

Please sign in to comment.