mock-prompt
mock inquirer prompt
Last updated 4 months ago by zce .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mock-prompt 
SYNC missed versions from official npm registry.

mock-prompt

Build Status Coverage Status NPM Downloads NPM Version License Dependency Status devDependency Status Code Style

mock inquirer prompt for unit/e2e test

TODO

Make sure the inquirer instance is one.

Installation

$ yarn add mock-prompt --dev

# or npm
$ npm install mock-prompt --save-dev

Usage

const inquirer = require('inquirer')
const mockPrompt = require('mock-prompt')

mockPrompt({ foo: 'hello foo' })

const questions = [
  { name: 'foo', type: 'input', message: 'foo' },
  { name: 'bar', type: 'confirm', message: 'bar', default: false }
]

inquirer.prompt(questions)
  .then(answers => {
    console.log(answers)
    // => { foo: 'hello foo', bar: false }
  })

API

mockPrompt(fills)

fills

  • Type: object
  • Details: fill answers

Contributing

  1. Fork it on GitHub!
  2. Clone the fork to your own machine.
  3. Checkout your feature branch: git checkout -b my-awesome-feature
  4. Commit your changes to your own branch: git commit -am 'Add some feature'
  5. Push your work back up to your fork: git push -u origin my-awesome-feature
  6. Submit a Pull Request so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

License

MIT © 汪磊

Current Tags

  • 0.1.5                                ...           latest (4 months ago)

6 Versions

  • 0.1.5                                ...           4 months ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |