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

feat: extract type defs to assert.d.ts #785

Merged
merged 1 commit into from
Jul 18, 2022
Merged

feat: extract type defs to assert.d.ts #785

merged 1 commit into from
Jul 18, 2022

Conversation

mxdvl
Copy link
Contributor

@mxdvl mxdvl commented Apr 29, 2022

What does this change?

Moves the type definitions of assertions into the main declaration file, under the LHCI.AssertResults namespace.

Why?

This allows the output JSON file to have an expected type. This is especially useful in Deno, where you can do:

// With a version number that’s not actually v0.9.0
import "https://raw.githubusercontent.com/GoogleChrome/lighthouse-ci/v0.9.0/types/assert.d.ts";

const results: LHCI.AssertResults.AssertionResult[] = JSON.parse(
	Deno.readTextFileSync(`.lighthouseci/assertion-results.json`)
);

This allows the output JSON file
to have an expected type.
@connorjclark
Copy link
Collaborator

Seems cool to me. Thanks.

@connorjclark connorjclark merged commit d218192 into GoogleChrome:main Jul 18, 2022
@mxdvl mxdvl deleted the mxdvl/assertion-results branch July 18, 2022 20:22
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