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 cdfd494
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ 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
run: |
Expand Down Expand Up @@ -227,7 +227,7 @@ 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
run: yarn test
run: yarn test --mode test-ci
9 changes: 6 additions & 3 deletions vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
export default defineConfig(({ mode }) => ({
test: {
watch: false,
globals: true,
setupFiles: ['test/setup.ts'],
alias: {
reselect: new URL('src/index.ts', import.meta.url).pathname, // @remap-prod-remove-line
reselect: new URL(
mode === 'test-ci' ? '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
}
}
})
}))

0 comments on commit cdfd494

Please sign in to comment.