@poi/plugin-transform-test-files v10.0.1
@poi/plugin-transform-test-files
How does this work:
- Transform your test files with Poi.
- Run custom test framework against transformed test file.
Install
yarn add @poi/plugin-transform-test-files --devUsage
Activate it in config file:
// poi.config.js
module.exports = {
plugins: [
require('@poi/plugin-transform-test-files')(/* options */)
]
}Then you can compile test files, by default it looks for **/*.test.js from the root, otherwise you could specify the directory by --baseDir:
poi test
# or somewhere else
poi test "src/*.test.js" "lib/*.spec.js"
# or from certain directory
poi test --baseDir "./test"The default generated test files can be found at in place as [name].transfromed.js, you can finally run it with your favorite test framework like AVA:
poi test && ava ./test/example.test.transformed.jsIf you want to bundle test files to certain directory, rather than at the same place as source. Please check the outputDir option below.
Note: You might put *.transfromed.js in .gitignore file.
Options
testFiles
Type: string Array
Default: **/*.{test,spec}.js
ignoreFiles
Type: Array
Default: ['!**/node_modules/**', '!**/vendor/**'])
baseDir
Type: string
Default: cwd
The directory to search testFiles.
outputDir
Type: string
Default: baseDir
The directory of transfromed test files.
// poi.config.js
module.exports = {
plugins: [
require('@poi/plugin-transform-test-files')({
outputDir: './test/_build'
})
]
}LICENSE
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago