Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Jun 21, 2024
1 parent c3194c6 commit f5ffebb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-and-test-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ jobs:
# Remove config line that points "reselect" to the `src` folder,
# so that the typetest will use the installed version instead
- name: Erase path aliases
run: sed -i -e /@remap-prod-remove-line/d tsconfig.base.json vitest.config.mts
run: sed -i -e /@remap-prod-remove-line/d tsconfig.base.json

- name: Test types
env:
TEST_DIST: true
run: |
yarn tsc --version
yarn type-tests
Expand Down Expand Up @@ -227,7 +229,9 @@ jobs:
run: yarn add ./package.tgz

- name: Erase path aliases
run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts
run: sed -i -e /@remap-prod-remove-line/d tsconfig.base.json

- name: Run local tests against the build artifact
env:
TEST_DIST: true
run: yarn test
5 changes: 4 additions & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export default defineConfig({
globals: true,
setupFiles: ['test/setup.ts'],
alias: {
reselect: new URL('src/index.ts', import.meta.url).pathname, // @remap-prod-remove-line
reselect: new URL(
process.env.TEST_DIST ? 'node_modules/reselect' : 'src/index.ts',
import.meta.url
).pathname,

// this mapping is disabled as we want `dist` imports in the tests only to be used for "type-only" imports which don't play a role for jest
'@internal': new URL('src', import.meta.url).pathname
Expand Down

0 comments on commit f5ffebb

Please sign in to comment.