1.0.0 • Published 5 years ago

jest-transform-multiple v1.0.0

Weekly downloads
1
License
MIT
Repository
bitbucket
Last release
5 years ago

Jest Transform Multiple

by Clark Inada

This module is an extention for Jest and provides a simple way to run multiple transforms.

Usage

Configuration in package.json

// this is the root of the package.json
{
    "jest-transform-multiple": string[] | {

        modules:[
            {
                path:string;
                config: object;
            }
        ];
        config:object;
    }
}
// this is the "jest" part of the package.json
{
    "jest":{
        ...otherJestOptions,
        "transform": {
            ".*test.*": "jest-transform-multiple"
        }
    }
}

Examples

Array of strings

{
    "jest-transform-multiple": ["module1", "module2"]
}

With configs

{
    "jest-transform-multiple": {
        "modules": [
            {
                "path": "<rootDir>/tranforms.js",
                "config": { "hello2": "world2" }
            }
        ],
        "config": {
            "hello":"world",
            "hello2":"world"
        }
    }
}

In the example above, the config will be merged and yield the following when the process method is invoked:

{
    ...configPassedFromJest
    "hello":"world",
    "hello2":"world2"
}

Download

Jest Transform Multiple is released under the licensed under the MIT license.

1.0.0

5 years ago

0.0.1-1

5 years ago

0.0.1-0

5 years ago