Skip to content

feat: add jest transformer#497

Merged
tvanhens merged 4 commits intomainfrom
tyler/jest-transformer
Sep 12, 2022
Merged

feat: add jest transformer#497
tvanhens merged 4 commits intomainfrom
tyler/jest-transformer

Conversation

@tvanhens
Copy link
Copy Markdown
Contributor

@tvanhens tvanhens commented Sep 12, 2022

This allows consumers to use functionless/jest as a jest transformer.

Also includes changes to merge in the behavior from hook.js so that the latest SQS feature will work for consumers.

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 12, 2022

Deploy Preview for effortless-malabi-1c3e77 ready!

Name Link
🔨 Latest commit 0567097
🔍 Latest deploy log https://app.netlify.com/sites/effortless-malabi-1c3e77/deploys/631f99b1cf967200097c4578
😎 Deploy Preview https://deploy-preview-497--effortless-malabi-1c3e77.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tvanhens tvanhens marked this pull request as ready for review September 12, 2022 19:47
jest.js Outdated
@@ -0,0 +1,8 @@
const swcJest = require("@swc/jest");
const { config } = require("./lib/swc");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The tests do not rely on lib currently, they rely on src. What happens if lib isn't present, will the tests require compilation now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd been using the test command which had been compiling before I realized that command was intended for the pipeline. This is a tricky one because ideally the register hook and the transformer share a config. However, if I convert them to ts files and move them to the top level then the TypeScript will generate a similar directory structure (files in src go to lib/src instead of just lib).

The simplest path, which is mentioned below, is to move the config to top level and make it a js file.

@tvanhens tvanhens merged commit afc0751 into main Sep 12, 2022
@tvanhens tvanhens deleted the tyler/jest-transformer branch September 12, 2022 22:36
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.

3 participants