Skip to content

Commit

Permalink
vitest fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Apr 29, 2024
1 parent 415021e commit a64b0b3
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- run: npm run build --if-present
working-directory: ${{env.working-directory}}

- run: npm run coverage -- --maxWorkers=2
- run: npm run coverage -- --bail 1
working-directory: ${{env.working-directory}}
env:
REACT_APP_TENANT: MOTI
Expand Down
2 changes: 1 addition & 1 deletion source/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"test": "tsc && vitest run",
"test-u": "tsc && vitest run -u",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage --reporter=vitest-sonar-reporter",
"coverage": "vitest run --coverage",
"update-snapshots": "vitest run -u",
"eject": "react-scripts eject",
"lint": "eslint src/ --ext .jsx,.js,.ts,.tsx --max-warnings 0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
RenderOptions,
waitFor,
waitForElementToBeRemoved,
screen,
} from '@/utils/test-utils';

import { ContactListPage } from './ContactListPage';
Expand Down Expand Up @@ -75,10 +76,9 @@ describe('Contact List View', () => {
});

it('matches snapshot', async () => {
setupMockSearch();
const { asFragment, getByText } = setup();
await act(async () => {});
setupMockSearch([defaultPersonSearchResult]);
const { asFragment } = setup();
await act(async () => {});

const fragment = await waitFor(() => asFragment());
expect(fragment).toMatchSnapshot();
Expand Down
Loading

0 comments on commit a64b0b3

Please sign in to comment.