@poi/plugin-transform-test-files
How does this work:
Last updated 2 years ago by egoist .
MIT* · Repository · Original npm · Tarball · package.json
$ cnpm install @poi/plugin-transform-test-files 
SYNC missed versions from official npm registry.

@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 --dev

Usage

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.js

If 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

MIT © EGOIST

Current Tags

  • 10.0.1                                ...           latest (2 years ago)
  • 10.0.0-beta.10                                ...           next (2 years ago)

9 Versions

  • 10.0.1                                ...           2 years ago
  • 10.0.0                                ...           2 years ago
  • 10.0.0-rc.1                                ...           2 years ago
  • 10.0.0-rc.0                                ...           2 years ago
  • 10.0.0-beta.10                                ...           2 years ago
  • 10.0.0-beta.9                                ...           3 years ago
  • 10.0.0-beta.8                                ...           3 years ago
  • 10.0.0-beta.7                                ...           3 years ago
  • 10.0.0-beta.2                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |