diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46832e9..4f88169 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,6 @@ name: CI -on: - push: - branches: [master] - pull_request: - branches: [master] +on: [push, pull_request, workflow_dispatch] jobs: build: @@ -76,9 +72,12 @@ jobs: - name: Install build artifact run: yarn add ./package.tgz - - run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts + - name: Erase path aliases + run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json - name: Run tests, against dist + env: + TEST_DIST: true run: yarn test test-types: @@ -108,7 +107,15 @@ jobs: - name: Install TypeScript ${{ matrix.ts }} run: yarn add typescript@${{ matrix.ts }} + - name: Install build artifact + run: yarn add ./package.tgz + + - name: Erase path aliases + 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 diff --git a/vitest.config.mts b/vitest.config.mts index 3c1a63e..43fbe0c 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -4,7 +4,10 @@ export default defineConfig({ test: { globals: true, alias: { - 'redux-thunk': new URL('src/index.ts', import.meta.url).pathname, // @remap-prod-remove-line + 'redux-thunk': new URL( + process.env.TEST_DIST ? 'node_modules/redux-thunk' : '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