Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Use Node 16 in unit tests #90

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

Drarig29
Copy link
Contributor

@Drarig29 Drarig29 commented Jul 14, 2023

Although we target Node 16, we are still using Node 10 in the unit tests.

This now makes the CI fail because of the ?. operator being used in JS. (see failing CI job)

For the record, this operator was introduced when bumping proxy-agent in datadog-ci in DataDog/datadog-ci#957. This package targets Node 14.

This PR bumps azure-pipelines-task-lib to version 4 (which supports Node 16 - see microsoft/azure-pipelines-task-lib#844) and passes 16 as a parameter of MockTestRunner.run().

@Drarig29 Drarig29 requested review from a team as code owners July 14, 2023 01:49
@@ -33,8 +34,11 @@ const runMockedTask = (mockName: string): MockTestRunner => {
throw Error(`The mocked task file does not exist: mocks/${mockName}.js\n` + 'Did you forget to run `yarn build`?')
}

// See `16.15.0` in `.node-version`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this comment to be able to easily grep for 16.15.0 and get all the places where the node version is used.

Copy link
Contributor

@jakepruitt jakepruitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@Drarig29 Drarig29 merged commit 610ac0a into main Jul 24, 2023
6 checks passed
@Drarig29 Drarig29 deleted the corentin.girard/use-node-16-for-unit-tests branch July 24, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants