Skip to content

Commit

Permalink
feat(testing): disable jest runtime by default when inferring targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Feb 7, 2025
1 parent 6a65db8 commit f1f2000
Show file tree
Hide file tree
Showing 3 changed files with 274 additions and 395 deletions.
165 changes: 165 additions & 0 deletions packages/jest/src/plugins/__snapshots__/plugin.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,61 @@ exports[`@nx/jest/plugin should add package as externalDependencies to the input
]
`;

exports[`@nx/jest/plugin should add package as externalDependencies to the inputs when specified as preset and containing a jest-preset.cjs file 2`] = `
[
[
"proj/jest.config.js",
{
"projects": {
"proj": {
"metadata": undefined,
"root": "proj",
"targets": {
"test": {
"cache": true,
"command": "jest",
"inputs": [
"default",
"^production",
{
"externalDependencies": [
"jest",
"some-package",
],
},
],
"metadata": {
"description": "Run Jest Tests",
"help": {
"command": "npx jest --help",
"example": {
"options": {
"coverage": true,
},
},
},
"technologies": [
"jest",
],
},
"options": {
"cwd": "proj",
"env": {
"TS_NODE_COMPILER_OPTIONS": "{"moduleResolution":"node10"}",
},
},
"outputs": [
"{workspaceRoot}/coverage",
],
},
},
},
},
},
],
]
`;

exports[`@nx/jest/plugin should add package as externalDependencies to the inputs when specified as preset and containing a jest-preset.js file 1`] = `
[
[
Expand Down Expand Up @@ -110,6 +165,61 @@ exports[`@nx/jest/plugin should add package as externalDependencies to the input
]
`;

exports[`@nx/jest/plugin should add package as externalDependencies to the inputs when specified as preset and containing a jest-preset.js file 2`] = `
[
[
"proj/jest.config.js",
{
"projects": {
"proj": {
"metadata": undefined,
"root": "proj",
"targets": {
"test": {
"cache": true,
"command": "jest",
"inputs": [
"default",
"^production",
{
"externalDependencies": [
"jest",
"some-package",
],
},
],
"metadata": {
"description": "Run Jest Tests",
"help": {
"command": "npx jest --help",
"example": {
"options": {
"coverage": true,
},
},
},
"technologies": [
"jest",
],
},
"options": {
"cwd": "proj",
"env": {
"TS_NODE_COMPILER_OPTIONS": "{"moduleResolution":"node10"}",
},
},
"outputs": [
"{workspaceRoot}/coverage",
],
},
},
},
},
},
],
]
`;

exports[`@nx/jest/plugin should add package as externalDependencies to the inputs when specified as preset and containing a jest-preset.json file 1`] = `
[
[
Expand Down Expand Up @@ -164,3 +274,58 @@ exports[`@nx/jest/plugin should add package as externalDependencies to the input
],
]
`;

exports[`@nx/jest/plugin should add package as externalDependencies to the inputs when specified as preset and containing a jest-preset.json file 2`] = `
[
[
"proj/jest.config.js",
{
"projects": {
"proj": {
"metadata": undefined,
"root": "proj",
"targets": {
"test": {
"cache": true,
"command": "jest",
"inputs": [
"default",
"^production",
{
"externalDependencies": [
"jest",
"some-package",
],
},
],
"metadata": {
"description": "Run Jest Tests",
"help": {
"command": "npx jest --help",
"example": {
"options": {
"coverage": true,
},
},
},
"technologies": [
"jest",
],
},
"options": {
"cwd": "proj",
"env": {
"TS_NODE_COMPILER_OPTIONS": "{"moduleResolution":"node10"}",
},
},
"outputs": [
"{workspaceRoot}/coverage",
],
},
},
},
},
},
],
]
`;
Loading

0 comments on commit f1f2000

Please sign in to comment.