jest: [Bug]: copying of jest root config to projects is broken/unintuitive
Version
29.6.4
Steps to reproduce
Given this configuration:
import { packageToModuleNameMapper } from "sutro-build";
import type { JestConfigWithTsJest } from "ts-jest";
const config: JestConfigWithTsJest = {
preset: "react-native",
projects: [
{ preset: "jest-expo/ios" },
{ preset: "jest-expo/android" },
{ preset: "jest-expo/web" },
],
transform: {
'^.+\\.jsx$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.json',
},
],
},
globals: {
__DEV__: true,
},
setupFiles: [
"react-native-gesture-handler/jestSetup.js",
],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
"**/*.{j,t}{s,sx}",
"!**/node_modules/**",
"!**/dist/**",
"!**/data/**",
"!**/__tests__/**",
"!**/__mocks__/**",
// Right now, we have to ignore these because otherwise Jest fails
"!**/src/components/**",
],
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/dist/"],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "babel",
// A list of reporter names that Jest uses when writing coverage reports
reporters: [
"default",
[
"jest-junit",
{
outputDirectory: "reports",
outputName: "report.xml",
ancestorSeparator: " › ",
uniqueOutputName: "false",
suiteNameTemplate: "{filepath}",
classNameTemplate: "{classname}",
titleTemplate: "{title}",
},
],
],
coverageReporters: [["lcov", { projectRoot: "../.." }]],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 1,
functions: 1,
lines: 1,
statements: 1,
},
},
testEnvironment: "jsdom",
rootDir: `${__dirname}`,
roots: [ "<rootDir>/src","<rootDir>/../../__mocks__"],
moduleNameMapper: {
...packageToModuleNameMapper(__dirname, { exclude: ["sutro-interpreter"] })
}
};
export default config;
Run yarn test --debug
and review the configuration
Expected behavior
I get the following configuration
{
"configs": [
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "iOS",
"color": "white"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "ios",
"platforms": [
"ios",
"native"
]
},
"id": "39dc19bf989cf7416f56fd9b62c54afa",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"ios.ts",
"ios.tsx",
"ios.js",
"ios.jsx",
"native.ts",
"native.tsx",
"native.js",
"native.jsx",
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleNameMapper": [],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter",
"/Users/dancrumb/Projects/Sutro/packages/interpreter/__tests__",
"/Users/dancrumb/Projects/Sutro/__mocks__"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/setup.js",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.ios.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/react-native-env.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.ios.[jt]s?(x)",
"**/__tests__/**/*test.ios.[jt]s?(x)",
"**/?(*.)+(spec|test).ios.[jt]s?(x)",
"**/__tests__/**/*spec.native.[jt]s?(x)",
"**/__tests__/**/*test.native.[jt]s?(x)",
"**/?(*.)+(spec|test).native.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
},
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "Android",
"color": "blueBright"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "android",
"platforms": [
"android",
"native"
]
},
"id": "a96109535fbd199d54aadb624aba6aec",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"android.ts",
"android.tsx",
"android.js",
"android.jsx",
"native.ts",
"native.tsx",
"native.js",
"native.jsx",
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleNameMapper": [],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter",
"/Users/dancrumb/Projects/Sutro/packages/interpreter/__tests__",
"/Users/dancrumb/Projects/Sutro/__mocks__"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/setup.js",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.android.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/react-native-env.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.android.[jt]s?(x)",
"**/__tests__/**/*test.android.[jt]s?(x)",
"**/?(*.)+(spec|test).android.[jt]s?(x)",
"**/__tests__/**/*spec.native.[jt]s?(x)",
"**/__tests__/**/*test.native.[jt]s?(x)",
"**/?(*.)+(spec|test).native.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
},
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "Web",
"color": "magenta"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "web",
"platforms": [
"web"
]
},
"id": "e5f841d836bdadeea32dfb9d6e8e82e8",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"web.ts",
"web.tsx",
"web.js",
"web.jsx",
"ts",
"tsx",
"js",
"jsx",
"json",
"wasm"
],
"moduleNameMapper": [
[
"^react-native$",
"react-native-web"
]
],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter",
"/Users/dancrumb/Projects/Sutro/packages/interpreter/__tests__",
"/Users/dancrumb/Projects/Sutro/__mocks__"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup-web.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.web.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/jest-environment-jsdom/build/index.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.web.[jt]s?(x)",
"**/__tests__/**/*test.web.[jt]s?(x)",
"**/?(*.)+(spec|test).web.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
}
],
"globalConfig": {
"bail": 0,
"changedFilesWithAncestor": false,
"ci": false,
"collectCoverage": false,
"collectCoverageFrom": [
"**/*.{j,t}{s,sx}",
"!**/node_modules/**",
"!**/dist/**",
"!**/data/**",
"!**/__tests__/**",
"!**/__mocks__/**",
"!**/src/components/**"
],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coverageProvider": "babel",
"coverageReporters": [
[
"lcov",
{
"projectRoot": "../.."
}
]
],
"coverageThreshold": {
"global": {
"branches": 1,
"functions": 1,
"lines": 1,
"statements": 1
}
},
"detectLeaks": false,
"detectOpenHandles": false,
"errorOnDeprecated": false,
"expand": false,
"findRelatedTests": false,
"forceExit": false,
"json": false,
"lastCommit": false,
"listTests": false,
"logHeapUsage": false,
"maxConcurrency": 5,
"maxWorkers": 9,
"noStackTrace": false,
"nonFlagArgs": [],
"notify": false,
"notifyMode": "failure-change",
"onlyChanged": false,
"onlyFailures": false,
"openHandlesTimeout": 1000,
"passWithNoTests": false,
"projects": [
{
"preset": "jest-expo/ios",
"roots": [
"<rootDir>",
"<rootDir>/__tests__",
"../../__mocks__"
],
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
},
{
"preset": "jest-expo/android",
"roots": [
"<rootDir>",
"<rootDir>/__tests__",
"../../__mocks__"
],
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
},
{
"preset": "jest-expo/web",
"roots": [
"<rootDir>",
"<rootDir>/__tests__",
"../../__mocks__"
],
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
}
],
"reporters": [
[
"default",
{}
],
[
"/Users/dancrumb/Projects/Sutro/node_modules/jest-junit/index.js",
{
"outputDirectory": "reports",
"outputName": "report.xml",
"ancestorSeparator": " › ",
"uniqueOutputName": "false",
"suiteNameTemplate": "{filepath}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}"
}
]
],
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"runTestsByPath": false,
"seed": -1190786307,
"skipFilter": false,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"testFailureExitCode": 1,
"testPathPattern": "",
"testSequencer": "/Users/dancrumb/Projects/Sutro/node_modules/@jest/test-sequencer/build/index.js",
"updateSnapshot": "new",
"useStderr": false,
"watch": false,
"watchAll": false,
"watchman": true,
"workerThreads": false
},
"version": "29.6.4"
}
Actual behavior
I see the result below.
Specifically, note that .configs.*.roots
{
"configs": [
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "iOS",
"color": "white"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "ios",
"platforms": [
"ios",
"native"
]
},
"id": "39dc19bf989cf7416f56fd9b62c54afa",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"ios.ts",
"ios.tsx",
"ios.js",
"ios.jsx",
"native.ts",
"native.tsx",
"native.js",
"native.jsx",
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleNameMapper": [],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/setup.js",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.ios.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/react-native-env.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.ios.[jt]s?(x)",
"**/__tests__/**/*test.ios.[jt]s?(x)",
"**/?(*.)+(spec|test).ios.[jt]s?(x)",
"**/__tests__/**/*spec.native.[jt]s?(x)",
"**/__tests__/**/*test.native.[jt]s?(x)",
"**/?(*.)+(spec|test).native.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
},
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "Android",
"color": "blueBright"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "android",
"platforms": [
"android",
"native"
]
},
"id": "a96109535fbd199d54aadb624aba6aec",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"android.ts",
"android.tsx",
"android.js",
"android.jsx",
"native.ts",
"native.tsx",
"native.js",
"native.jsx",
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleNameMapper": [],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/setup.js",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.android.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/react-native/jest/react-native-env.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.android.[jt]s?(x)",
"**/__tests__/**/*test.android.[jt]s?(x)",
"**/?(*.)+(spec|test).android.[jt]s?(x)",
"**/__tests__/**/*spec.native.[jt]s?(x)",
"**/__tests__/**/*test.native.[jt]s?(x)",
"**/?(*.)+(spec|test).native.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
},
{
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/hk/z614k7h119n33vqm4smys2p00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"detectLeaks": false,
"detectOpenHandles": false,
"displayName": {
"name": "Web",
"color": "magenta"
},
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {},
"haste": {
"defaultPlatform": "web",
"platforms": [
"web"
]
},
"id": "e5f841d836bdadeea32dfb9d6e8e82e8",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"web.ts",
"web.tsx",
"web.js",
"web.jsx",
"ts",
"tsx",
"js",
"jsx",
"json",
"wasm"
],
"moduleNameMapper": [
[
"^react-native$",
"react-native-web"
]
],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"roots": [
"/Users/dancrumb/Projects/Sutro/packages/interpreter"
],
"runner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/setup-web.js"
],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotResolver": "/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/snapshot/resolver.web.js",
"snapshotSerializers": [],
"testEnvironment": "/Users/dancrumb/Projects/Sutro/node_modules/jest-environment-jsdom/build/index.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/__tests__/**/*spec.[jt]s?(x)",
"**/__tests__/**/*test.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*spec.web.[jt]s?(x)",
"**/__tests__/**/*test.web.[jt]s?(x)",
"**/?(*.)+(spec|test).web.[jt]s?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/dancrumb/Projects/Sutro/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.(js|ts|tsx)$",
"/Users/dancrumb/Projects/Sutro/node_modules/babel-jest/build/index.js",
{}
],
[
"^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp|ttf|otf|m4v|mov|mp4|mpeg|mpg|webm|aac|aiff|caf|m4a|mp3|wav|html|pdf|obj)$",
"/Users/dancrumb/Projects/Sutro/node_modules/jest-expo/src/preset/assetFileTransformer.js",
{}
]
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"watchPathIgnorePatterns": []
}
],
"globalConfig": {
"bail": 0,
"changedFilesWithAncestor": false,
"ci": false,
"collectCoverage": false,
"collectCoverageFrom": [
"**/*.{j,t}{s,sx}",
"!**/node_modules/**",
"!**/dist/**",
"!**/data/**",
"!**/__tests__/**",
"!**/__mocks__/**",
"!**/src/components/**"
],
"coverageDirectory": "/Users/dancrumb/Projects/Sutro/packages/interpreter/coverage",
"coverageProvider": "babel",
"coverageReporters": [
[
"lcov",
{
"projectRoot": "../.."
}
]
],
"coverageThreshold": {
"global": {
"branches": 1,
"functions": 1,
"lines": 1,
"statements": 1
}
},
"detectLeaks": false,
"detectOpenHandles": false,
"errorOnDeprecated": false,
"expand": false,
"findRelatedTests": false,
"forceExit": false,
"json": false,
"lastCommit": false,
"listTests": false,
"logHeapUsage": false,
"maxConcurrency": 5,
"maxWorkers": 9,
"noStackTrace": false,
"nonFlagArgs": [],
"notify": false,
"notifyMode": "failure-change",
"onlyChanged": false,
"onlyFailures": false,
"openHandlesTimeout": 1000,
"passWithNoTests": false,
"projects": [
{
"preset": "jest-expo/ios",
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
},
{
"preset": "jest-expo/android",
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
},
{
"preset": "jest-expo/web",
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter"
}
],
"reporters": [
[
"default",
{}
],
[
"/Users/dancrumb/Projects/Sutro/node_modules/jest-junit/index.js",
{
"outputDirectory": "reports",
"outputName": "report.xml",
"ancestorSeparator": " › ",
"uniqueOutputName": "false",
"suiteNameTemplate": "{filepath}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}"
}
]
],
"rootDir": "/Users/dancrumb/Projects/Sutro/packages/interpreter",
"runTestsByPath": false,
"seed": 382697755,
"skipFilter": false,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"testFailureExitCode": 1,
"testPathPattern": "",
"testSequencer": "/Users/dancrumb/Projects/Sutro/node_modules/@jest/test-sequencer/build/index.js",
"updateSnapshot": "new",
"useStderr": false,
"watch": false,
"watchAll": false,
"watchman": true,
"workerThreads": false
},
"version": "29.6.4"
}
Additional context
Explicitly setting roots
in the projects
property of the config file gets the desired result, but this points to the problem.
Either the copying of roots
to the ProjectConfig
s of each project
is broken, or the process by which this value is copied over is unintuitive (it would seem reasonable that it would be copied or merged with anything in the preset.
Since this process is undocumented, it’s unclear whether this is working as designed, and the process needs documenting, or whether this is indeed a bug and needs fixing.
Environment
System:
OS: macOS 13.5.1
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
Yarn: 3.6.2 - ~/.nvm/versions/node/v18.17.1/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 4
- Comments: 15
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.