-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): WIP: setup config so it doesn't require building packages
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import {configDefaults, defineConfig} from 'vitest/config' | ||
|
||
import {getAliases} from '../../../vitest-aliases' | ||
|
||
export default defineConfig({ | ||
test: { | ||
alias: getAliases(), | ||
typecheck: { | ||
exclude: [...(configDefaults.typecheck?.exclude || []), '.tmp/**'], | ||
exclude: [...(configDefaults.typecheck?.exclude || []), '.tmp/**', './lib/**'], | ||
}, | ||
exclude: [...configDefaults.exclude, '.tmp/**'], | ||
exclude: [...configDefaults.exclude, '.tmp/**', './lib/**'], | ||
includeSource: ['./src/**/*.ts'], | ||
}, | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import path from 'path' | ||
|
||
import devAliases from './dev/aliases.cjs' | ||
|
||
export function getAliases() { | ||
return resolveAliasPaths(devAliases) | ||
} | ||
function resolveAliasPaths(aliases: Record<string, string>) { | ||
const result: Record<string, string> = {} | ||
|
||
for (const [aliasPattern, aliasPath] of Object.entries(aliases)) { | ||
result[aliasPattern] = path.resolve(__dirname, aliasPath) | ||
} | ||
|
||
return result | ||
} |