All Projects → xudafeng → command-line-test

xudafeng / command-line-test

Licence: other
command-line test tool for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to command-line-test

Macaca
Automation solution for multi-platform. 多端自动化解决方案
Stars: ✭ 2,991 (+21264.29%)
Mutual labels:  macaca
dom-event-simulate
simulate user interaction with DOM events.
Stars: ✭ 23 (+64.29%)
Mutual labels:  macaca
egg-datahub
Macaca DataHub plugin for Egg.js
Stars: ✭ 19 (+35.71%)
Mutual labels:  macaca
macaca-adb
Node.js wrapper for ADB.
Stars: ✭ 36 (+157.14%)
Mutual labels:  macaca
UIAutomatorWD
Node.js wrapper for Android UIAutomator.
Stars: ✭ 51 (+264.29%)
Mutual labels:  macaca
wd.py
Python Client binding for Macaca
Stars: ✭ 33 (+135.71%)
Mutual labels:  macaca
android-unicode
Android unicode UTF-7 input apk
Stars: ✭ 23 (+64.29%)
Mutual labels:  macaca
sample-java
Macaca test sample for Java
Stars: ✭ 23 (+64.29%)
Mutual labels:  macaca
nodecv-server
nodecv server side
Stars: ✭ 16 (+14.29%)
Mutual labels:  macaca
sample-nodejs
Macaca test sample for Node.js
Stars: ✭ 44 (+214.29%)
Mutual labels:  macaca
iosHookViewId
A solution for ios hook view id(给iOS应用自动生成控件id)
Stars: ✭ 44 (+214.29%)
Mutual labels:  macaca
wd.java
Java Client binding for Macaca
Stars: ✭ 30 (+114.29%)
Mutual labels:  macaca
macaca-puppeteer
Macaca puppeteer driver
Stars: ✭ 39 (+178.57%)
Mutual labels:  macaca

command-line-test

NPM version build status Test coverage node version npm download

command-line test tool for Node.js

Installment

$ npm i command-line-test --save-dev

Usage

fork, spawn, exec, execFile supported.

const CliTest = require('command-line-test');

describe('test', function() {
  it('constructor should be ok', function() {
    CliTest.should.be.ok();
  });

  it('exec method should be ok with yeild', function *() {
    const cliTest = new CliTest();
    const res = yield cliTest.exec('cat package.json');
    /**
    * res return
    * {
    *   error,
    *   stdout,
    *   stderr
    * }
    */
    const _pkg = JSON.parse(res.stdout);
    pkg.name.should.be.equal(_pkg.name);
  });

  it('exec method should be ok with promise', function(done) {
    const cliTest1 = new CliTest();
    cliTest1.exec('cat package.json').then(res => {
      const _pkg = JSON.parse(res.stdout);
      pkg.name.should.be.equal(_pkg.name);
      done();
    });
  });

  it('exec method should be ok with callback', function(done) {
    const cliTest1 = new CliTest();
    cliTest1.exec('cat package.json', function(err, res) {
      const _pkg = JSON.parse(res.stdout);
      pkg.name.should.be.equal(_pkg.name);
      done();
    });
  });
});

Sample

License

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].