Skip to content

Add support for Typescript Jest tests#327

Closed
br-lewis wants to merge 6 commits intomainfrom
FUZZ-567-jest-typescript
Closed

Add support for Typescript Jest tests#327
br-lewis wants to merge 6 commits intomainfrom
FUZZ-567-jest-typescript

Conversation

@br-lewis
Copy link
Contributor

This adds support for Jest tests that are written in Typescript along with an example of how that would look.

The primary change is in packages/jest-runner/worker.ts where we swapped out our own call to import with a call to Jest's transformer functionality which can (via ts-jest) load Typescript files and convert them to Javascript before being put through jazzer.js's instrumentor.

One change that I'm not sure about is packages/jest-runner/jest-extension.ts where I modify Jest's It interface to allow our fuzz.ts files to pass the type checker but this requires importing jest-extension in every test file. If anyone knows a better way to handle this, that'd be great.

@br-lewis br-lewis requested a review from a team February 15, 2023 13:18
@br-lewis br-lewis force-pushed the FUZZ-567-jest-typescript branch from e1a1dcf to 5376a9c Compare February 15, 2023 14:00
This allows the tests to actually run something when not in fuzzing mode
@br-lewis
Copy link
Contributor Author

The CI tests revealed that this change will break code coverage for Javascript and fixing that will require a much larger change than expected. So we're going to close this for now until we can fix it properly.

@br-lewis br-lewis closed this Feb 22, 2023
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.

1 participant

Comments