Skip to content

Commit 174f7a0

Browse files
add jest dom for fluent assertions
1 parent 5031d72 commit 174f7a0

File tree

6 files changed

+77
-10
lines changed

6 files changed

+77
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"types": ["cypress", "node"]
4+
"types": ["cypress", "node", "@types/testing-library__cypress"]
55
},
66
"include": ["**/*.ts", "**/*.js"]
77
}

apps/angular-testing/src/app/app.component.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ test('should be able to load albums', async () => {
3030

3131
fireEvent.click(screen.getByRole('button', { name: /get albums/i }));
3232

33-
await screen.findByText(/sarah/i);
33+
const album = await screen.findByText(/sarah/i);
34+
expect(album).toBeInTheDocument();
3435

36+
// Accessibility checks
3537
const results = await axe(container)
3638

3739
expect(results).toHaveNoViolations()

apps/angular-testing/src/test-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'jest-preset-angular';
2+
import '@testing-library/jest-dom'
23
// import { server } from './mocks/node';
34

45
// beforeAll(() => server.listen());

apps/angular-testing/tsconfig.spec.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"module": "commonjs",
6-
"types": [
7-
"jest",
8-
"node",
9-
"cypress",
10-
"@types/testing-library__cypress",
11-
"@types/jest-axe",
12-
"jest-axe"
13-
]
6+
"types": ["jest", "node", "@types/jest-axe", "jest-axe"]
147
},
158
"files": ["src/test-setup.ts"],
169
"include": ["**/*.spec.ts", "**/*.d.ts"]

package-lock.json

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@pact-foundation/pact": "^9.11.0",
5454
"@testing-library/angular": "^9.5.0",
5555
"@testing-library/cypress": "^6.0.0",
56+
"@testing-library/jest-dom": "^5.11.0",
5657
"@types/jest": "25.1.4",
5758
"@types/jest-axe": "^3.2.2",
5859
"@types/node": "~8.9.4",

0 commit comments

Comments
 (0)