@component-controls/jest-extract
v4.0.3
Published
Given a test file, extracts the tests, test results and coverage data
Downloads
119
Readme
Table of contents
Overview
Given a file name, retrives the jest tests and associated results.
Installation
This package is usually installed as part of the @component-controls package, but you can also install it standalone:
$ npm install @component-controls/jest-extract --save-dev
API
getRelatedTests
find all test files related to a component file
getRelatedTests source code
runRelatedTests
retrieves all the tests related to a componnet file
runRelatedTests source code
findJestConfig
findJestConfig source code
runTests
single test file execution
runTests source code
runProjectTests
run tests within the same project (jest config file)
runProjectTests source code
properties
| Name | Type | Description |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| testFiles*
| string[] | related test files to execute |
| projectFolder*
| string | the folder with jest configuration or package.json |
| relativeFolder
| string | if supplied, this is the folder from which to report the file names relative to for example this could be the folder where the tested component resides |
| options*
| Partial<Arguments<Partial<{ all: boolean; automock: boolean; bail: number | boolean; cache: boolean; cacheDirectory: string; changedFilesWithAncestor: boolean; changedSince: string; ci: boolean; clearCache: boolean; ... 77 more ...; watchPathIgnorePatterns: string[]; }>>> | jest options. Can provide collectCoverageOnlyFrom to limit the files coverage is collected from |