Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @testing-library to the default templates #7881

Merged
merged 9 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix template tests
  • Loading branch information
ianschmitz committed Oct 29, 2019
commit 06b2617a70a7b9b2ef6344d19f6e1bbe00e89b5d
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"compile:lockfile": "node tasks/compile-lockfile.js"
},
"devDependencies": {
"@testing-library/react": "^9.3.0",
"@testing-library/jest-dom": "^4.2.0",
"@testing-library/user-event": "^7.1.2",
"alex": "^8.0.0",
"eslint": "^6.1.0",
"execa": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cra-template-typescript/template/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import App from './App';

test('renders welcome heading', () => {
const { getByRole } = render(<App />);
const headingElement = getByRole('heading');
expect(headingElement).toHaveTextContent(/welcome/i);
const linkElement = getByRole('link');
expect(linkElement).toHaveTextContent(/learn react/i);
});
4 changes: 2 additions & 2 deletions packages/cra-template/template/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import App from './App';

test('renders welcome heading', () => {
const { getByRole } = render(<App />);
const headingElement = getByRole('heading');
expect(headingElement).toHaveTextContent(/welcome/i);
const linkElement = getByRole('link');
expect(linkElement).toHaveTextContent(/learn react/i);
});