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

test issues, need help #51

Closed
vertic4l opened this issue Dec 1, 2021 · 1 comment
Closed

test issues, need help #51

vertic4l opened this issue Dec 1, 2021 · 1 comment

Comments

@vertic4l
Copy link

vertic4l commented Dec 1, 2021

Hey,

i've tried esbuild-jest which works better out of the box, but has issues with jest-mock() inside of test files.
Now i wanted to try swc-jest, which needs a lot more configuration and fiddling, but i don't get it to work.

In my jest.config.js we explicitly tell jest to look for these files:

testRegex: [".spec.(ts|tsx)$"],

but this seems to be ignored with swc-jest, cause its going through files which are not used in the test.

Bildschirmfoto 2021-12-01 um 12 26 57

my .swcrc looks like this:

{
    "jsc": {
        "parser": {
            "syntax": "typescript",
            "tsx": true,
            "decorators": true,
            "dynamicImport": true
        },
        "transform": {
            "react": {
                "development": false,
                "useBuiltins": false,
                "runtime": "automatic"
            },
            "optimizer": {
                "globals": {
                    "vars": {
                        "__DEBUG__": "true"
                    }
                }
            },
            "legacyDecorator": true,
            "decoratorMetadata": true
        },
        "target": "es5",
        "loose": false,
        "externalHelpers": true,
        "keepClassNames": false
    }
}

Seems to me it tries to compile the whole project

@kdy1
Copy link
Member

kdy1 commented Mar 12, 2022

This is not an issue of swc/jest.

@kdy1 kdy1 closed this as completed Mar 12, 2022
@swc-project swc-project locked as off-topic and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants