-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4668 from aryaemami59/modernize-vitest-config
Modernize vitest config
- Loading branch information
Showing
5 changed files
with
251 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
// No __dirname under Node ESM | ||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
include: ['./test/**/*.(spec|test).[jt]s?(x)'], | ||
alias: { | ||
redux: './src/index.ts', // @remap-prod-remove-line | ||
redux: path.join(__dirname, './src/index.ts'), // @remap-prod-remove-line | ||
|
||
// 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/': './src/' | ||
}, | ||
deps: { | ||
interopDefault: true | ||
'@internal': path.join(__dirname, 'src') | ||
} | ||
} | ||
}) |
Oops, something went wrong.