Generate a Jest configuration object for an specific package.
ES6
// ./packages/packageA/jest.config.ts
import { jestPackageConfig } from "@elmijo/monorepo-helper"
export default jestPackageConfig({ projectDir: __dirname })
CommonJS
// ./packages/packageA/jest.config.ts
const { jestPackageConfig } = require("@elmijo/monorepo-helper")
module.exports = jestPackageConfig({ projectDir: __dirname })
ES6
// ./packages/packageA/jest.config.ts
import { Config } from "@jest/types"
import { jestPackageConfig } from "@elmijo/monorepo-helper"
export default {
...jestPackageConfig({ projectDir: __dirname }),
verbode: true
} as Config.InitialOptions
CommonJS
// ./packages/packageA/jest.config.ts
const { jestPackageConfig } = require("@elmijo/monorepo-helper")
module.exports = {
...jestPackageConfig({ projectDir: __dirname })
verbose: true
}
configuration options to generate a Jest configuration.
The name of the tsconfig file.
A Jest configuration object.
Generate a root Jest configuration object for monorepos.
ES6
// jest.config.ts
import { jestRootConfig } from "@elmijo/monorepo-helper"
export default jestRootConfig(["./packages"])
CommonJS
// jest.config.ts
const { jestRootConfig } = require("@elmijo/monorepo-helper")
module.exports = jestRootConfig(["./packages"])
ES6
// jest.config.ts
import { Config } from "@jest/types"
import { jestRootConfig } from "@elmijo/monorepo-helper"
export default {
...jestRootConfig(["./packages"]),
verbose: true
} as Config.InitialOptions
CommonJS
// jest.config.ts
const { jestRootConfig } = require("@elmijo/monorepo-helper");
module.exports = {
...jestRootConfig(["./packages"]),
verbose: true
};
List of package repositories
The name of the Typescript configuration
Return a Jest configuration object.
Generated using TypeDoc
Here you can find some helpers to make you Jest configuration easier.