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

Lit + Jest + Typescript + SWC Jest #8734

Open
gethari opened this issue Mar 12, 2024 · 0 comments
Open

Lit + Jest + Typescript + SWC Jest #8734

gethari opened this issue Mar 12, 2024 · 0 comments
Labels

Comments

@gethari
Copy link

gethari commented Mar 12, 2024

Describe the bug

I am trying to use @swc/jest to speed up my tests on my lit+typescript+jest setup. When using the swc/jest as the test runner the willUpdate method is not getting executed. From what I see/find the call stack is different when using ts-jest & it works fine, but on using swc/jest the callstack is missing the _callSuper().

I am attaching a simple repository that can reproduce the issue. Btw here's some screenshots that shows the above, if it is helpful

swc

image

ts-jest

image

Input code

No response

Config

{
    "$schema": "https://json.schemastore.org/swcrc",
    "jsc": {
        "parser": {
            "syntax": "typescript",
            "dynamicImport": true,
            "decorators": true
        },
        "target": "es2022"
    }
}

Playground link (or link to the minimal reproduction)

https://github.com/gethari/typescript-webpack-lit-html-jest-swc

SWC Info output

Operating System:
Platform: linux
Arch: x64
Machine Type: x86_64
Version: #19~22.04.1-Ubuntu SMP Wed Jan 10 22:57:03 UTC 2024
CPU: (2 cores)
Models: AMD EPYC 7763 64-Core Processor

Binaries:
    Node: 20.11.1
    npm: 10.2.4
    Yarn: 1.22.19
    pnpm: 8.15.4

Relevant Packages:
    @swc/core: 1.4.6
    @swc/helpers: N/A
    @swc/types: 0.1.5
    typescript: 5.4.2

SWC Config:
    output: N/A
    .swcrc path: N/A

Next.js info:
    output: N/A

Expected behavior

swc/jest should not break existing tests & should call lit component lifecycle's willUpdate() method

Actual behavior

willUpdate() method is not getting executed.

Version

1.4.6

Additional context

Not sure if this issue is specific to jest or lit or swc , I have filed the same issue on other repositories as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant