fix(deps): move file-type to deps (#6171)
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
/**
|
||||
* Ignores all ESM packages that make Jest mad.
|
||||
*
|
||||
* "Jest encountered an unexpected token"
|
||||
*
|
||||
* Direct packages:
|
||||
* - file-type
|
||||
*/
|
||||
const esModules = [
|
||||
// file-type and all dependencies: https://github.com/sindresorhus/file-type
|
||||
'file-type',
|
||||
'strtok3',
|
||||
'readable-web-to-node-stream',
|
||||
'token-types',
|
||||
'peek-readable',
|
||||
].join('|')
|
||||
|
||||
/** @type {import('jest').Config} */
|
||||
const baseJestConfig = {
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
@@ -14,6 +31,10 @@ const baseJestConfig = {
|
||||
transform: {
|
||||
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
`/node_modules/(?!.pnpm)(?!(${esModules})/)`,
|
||||
`/node_modules/.pnpm/(?!(${esModules.replace(/\//g, '\\+')})@)`,
|
||||
],
|
||||
verbose: true,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user