Skip to content

Update JavaScript tests for cross-version compatibility (14, 16)#6845

Merged
aduth merged 1 commit intomainfrom
aduth-node-16-compat
Aug 26, 2022
Merged

Update JavaScript tests for cross-version compatibility (14, 16)#6845
aduth merged 1 commit intomainfrom
aduth-node-16-compat

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Aug 26, 2022

Why: As a precursor to #6841, in order to prevent timing issues between upgrading to Node.js v16 in the IdP and in the GitLab CI runner, update specs so that they pass in the current (14) and upgraded (16) versions.

Testing Instructions:

Ensure tests pass in Node.js v14 and Node.js v16:

nvm install 16 && nvm use 16 && yarn && yarn test
nvm install 14 && nvm use 14 && yarn && yarn test

**Why**: As a precursor to #6841, in order to prevent timing issues between upgrading to Node.js v16 in the IdP and in the GitLab CI runner, update specs so that they pass in the current (14) and upgraded (16) versions.

changelog: Internal, Build Tooling, Upgrade Node.js to v16

declare global {
interface HTMLElementTagNameMap {
'lg-time': TimeElement;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a bit non-obvious, but what this is doing is making it so that the createElement call in the spec will have the current inferred return type based on document.createElement so that the reference to element.formatter doesn't produce a type error.

Before After
image image

@aduth aduth requested a review from eric-gade August 26, 2022 13:47
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@aduth aduth merged commit 7a73a7b into main Aug 26, 2022
@aduth aduth deleted the aduth-node-16-compat branch August 26, 2022 15:59
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.

2 participants