Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-konshin committed Feb 2, 2023
1 parent 1d44690 commit 5844ffd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ jobs:
env:
CI: true

# FIXME Coverage report

- uses: actions/upload-artifact@v3
if: failure()
with:
path: packages/*/test-results
path: |
packages/*/test-results
packages/*/coverage
- run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

Expand Down
3 changes: 3 additions & 0 deletions packages/wrapper/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('@jest/types').Config.GlobalConfig} */
module.exports = {
preset: 'ts-jest',
collectCoverage: true,
coveragePathIgnorePatterns: ['./node_modules', './.next', './tests'],
coverageReporters: ['text', 'lcov'],
coverageProvider: 'v8',
testEnvironment: 'node',
};
3 changes: 3 additions & 0 deletions packages/wrapper/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ export const createWrapper = <S extends Store>(makeStore: MakeStore<S>, config:
);

// This guard is solely to suppress Next.js warning about useless layout effect
// Coverage is not gathered, all checks are via demo apps
/* c8 ignore start */
if (!getIsServer()) {
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
Expand Down Expand Up @@ -336,6 +338,7 @@ export const createWrapper = <S extends Store>(makeStore: MakeStore<S>, config:
return {hydrating};
}
}
/*c8 ignore end */

/**
* When we navigate client side, we may always synchronously hydrate the state before the new page components
Expand Down

0 comments on commit 5844ffd

Please sign in to comment.