@lwc/jest-transformer

16.0.0 • Public • Published

@lwc/jest-transformer

Compile Lightning web components for Jest tests.

About Jest Transformers

Jest transformers modify source files in preparation for tests based on regular expressions. See Jest docs for more information.

The transformer modules in this package allow LWC developers to test components that reference @salesforce modules by transforming those import statements into assignment statements that work outside of a Salesforce application container.

Installation

yarn add -D @lwc/jest-transformer

Usage

Update your jest config to point the transformer to this package:

{
    "jest": {
        "moduleFileExtensions": ["js", "html"],
        "transform": {
            "^.+\\.(js|html|css)$": "@lwc/jest-transformer"
        }
    }
}

Dependencies (10)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @lwc/jest-transformer

    Homepage

    lwc.dev/

    Weekly Downloads

    68,467

    Version

    16.0.0

    License

    MIT

    Unpacked Size

    36.6 kB

    Total Files

    21

    Last publish

    Collaborators

    • divmain
    • lwc-admin
    • caridy
    • tbliss
    • pmdartus
    • ekashida
    • kevinv11n
    • jye-sf
    • rui.qiu
    • ravi.jayaramappa
    • jodarove
    • abdulsattar
    • nolanlawson
    • jmsjtu