Skip to content

Commit d22a86e

Browse files
authored
chore: Run Unit Tests on Node 16 and 18 (#35622)
* initial * update node 18 * fix test??? * revert change * change version * update node version * mock trackError * include sourceMessage * revert version change
1 parent 1cebb71 commit d22a86e

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

.circleci/config.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ aliases:
110110
- lint
111111
- typecheck
112112
- unit_tests_node14
113+
- unit_tests_node16
114+
- unit_tests_node18
113115

114116
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
115117
<<: *e2e-executor
@@ -221,12 +223,23 @@ jobs:
221223
- run: yarn check-repo-fields
222224

223225
unit_tests_node14:
224-
# GATSBY_EXPERIMENTAL_LMDB_INDEXES is not activated yet
225226
executor:
226227
name: node
227228
image: "14.15.0"
228229
<<: *test_template
229230

231+
unit_tests_node16:
232+
executor:
233+
name: node
234+
image: "16.15.0"
235+
<<: *test_template
236+
237+
unit_tests_node18:
238+
executor:
239+
name: node
240+
image: "18.2.0"
241+
<<: *test_template
242+
230243
integration_tests_gatsby_source_wordpress:
231244
machine:
232245
image: "ubuntu-2004:202107-02"
@@ -593,6 +606,18 @@ workflows:
593606
- lint
594607
- typecheck
595608
- bootstrap
609+
- unit_tests_node16:
610+
<<: *ignore_docs
611+
requires:
612+
- lint
613+
- typecheck
614+
- bootstrap
615+
- unit_tests_node18:
616+
<<: *ignore_docs
617+
requires:
618+
- lint
619+
- typecheck
620+
- bootstrap
596621
- integration_tests_gatsby_source_wordpress:
597622
<<: *e2e-test-workflow
598623
- integration_tests_node_manifest:

packages/gatsby-cli/src/structured-errors/error-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ const errors = {
708708
},
709709
"11903": {
710710
text: (context): string =>
711-
`There was an unhandled error during compilation for ${context.siteRoot}. Please run the command with the --verbose flag again.`,
711+
`There was an unhandled error during compilation for ${context.siteRoot}. Please run the command with the --verbose flag again.\n${context.sourceMessage}`,
712712
level: Level.ERROR,
713713
type: Type.COMPILATION,
714714
category: ErrorCategory.USER,

packages/gatsby/src/utils/parcel/compile-gatsby-files.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export async function compileGatsbyFiles(siteRoot: string): Promise<void> {
7272
error,
7373
context: {
7474
siteRoot,
75+
sourceMessage: error.message,
7576
},
7677
})
7778
}

packages/gatsby/src/utils/worker/__tests__/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jest.mock(`gatsby-telemetry`, () => {
1010
decorateEvent: jest.fn(),
1111
trackCli: jest.fn(),
1212
isTrackingEnabled: jest.fn(),
13+
trackError: jest.fn(),
1314
}
1415
})
1516

packages/gatsby/src/utils/worker/__tests__/jobs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jest.mock(`gatsby-telemetry`, () => {
1212
decorateEvent: jest.fn(),
1313
trackCli: jest.fn(),
1414
isTrackingEnabled: jest.fn(),
15+
trackError: jest.fn(),
1516
}
1617
})
1718

0 commit comments

Comments
 (0)