-
Notifications
You must be signed in to change notification settings - Fork 209
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
Unexpected token 'export' when using @aws-sdk
with Jest
#271
Comments
Hey! 👋 Which version of |
Hey. I'm on Interestingly I have been able to work around it by mocking the jest.mock('uuid', () => 'eb7b7961-395d-4b4c-afc6-9ebcadaf0150'); Not ideal, but helps me out in my case. Though this would become an issue I guess if I wanted to directly use |
same issue |
1 similar comment
same issue |
same issue, has anyone found a solution? |
Same issue |
Same |
microsoft/accessibility-insights-web#5421 (comment) This solve my problem create a resolver. the uuid has a incompatibility with jest. |
What is the solution for this issue ? i am on jest 29.0 and have the same issue. |
@maxy4u as @andreMycroft mentioned, the resolver. He could be a little bit more specific I guess 😝 : |
Thank you @mkbctrl I will try this. :) |
I have created a new worker using
npx wrangler init
with typescript. I am using the@aws-sdk/client-eventbridge
package in my worker. However, when I try and mock it in tests usingaws-sdk-client-mock
I get the following error.This appears to be an ES module issue and only occurs when I have
new EventBridgeClient({})
in my test code.My jest config looks like this.
If I change
testEnvironment
tonode
, the error no longer occurs and the test will pass. However, I loose the miniflare benefits in jest.Is there something I'm missing here to get this working with the
miniflare
test environment?The text was updated successfully, but these errors were encountered: