@caviar/test
Testing utility for caviar
Last updated 8 months ago by kael .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @caviar/test 
SYNC missed versions from official npm registry.

Build Status Coverage

@caviar/test

Testing utility for caviar, caviar blocks, and caviar plugins

Install

$ npm i @caviar/test -D

Usage

const {
  runBlock
} = require('@caviar/test')

const block = await runBlock(NextBlock, options)

await runBlock(block: Class, options: RunBlockOptions): Block

  • block Class the subclass of caviar.Block
  • options RunBlockOptions
interface RunBlockOptions {
  // Which is the same as the apply function of caviar.Plugin
  apply?: Function(getHooks: Function)
  // Array of config layers
  // [app layer, lower layer, ..., the lowest layer]
  configChain: Array<object>
  // The current working directory
  cwd: string
  dev?: boolean = false
  phase?: string = 'default'
}

Returns Block the block which has already run.

License

MIT

Current Tags

  • 2.0.2                                ...           latest (8 months ago)

5 Versions

  • 2.0.2                                ...           8 months ago
  • 2.0.1                                ...           8 months ago
  • 2.0.0                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 6
Last Month 1
Dependencies (4)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |