appc-cli-mocha
simple, flexible, fun mocha framework extension with server response mock-ing
Last updated 6 months ago by appcelerator .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install appc-cli-mocha 
SYNC missed versions from official npm registry.

appc-cli-mocha Build Status

Features

  • Authomatically redirects all tthe raffic from the appc-cli to the internal request mocker
  • Added support for OS specific tests
  • Logs from appc-logger are automatically stored for easy access

Getting started

$ npm install -g appc-cli-mocha

This library depends on MochaJS.

API

All the features of appc-cli-mocha can be accessed as a library.

var core = require('appc-cli-mocha');
core.newTest('', {
	endpoints: [
		{
			method: 'all',
			path: '/*',
			/** [execute description] */
			handle: function (req, opts, res, next) {
				console.log('[MOCK-ADDR]', req.url);
				return next();
			}
		}...
	]
}, function (err, plugin) {
	var appc = this.appc,
		tmpDir = this.tmpDir,
		async = appc.async;

	describe('OS restrictive conditional tests', function () {
		it.mac('mac only condition', function () {

		});

		it.linux('linux only condition', function () {

		});

		it.win('win only condition', function () {

		});
	});

	describe('express test', function () {
		it('endpoint /test', function (done) {
			request({
				method: 'get',
				url: 'http://127.0.0.1:8118/test',
				json: true
			}, function (err, req, res) {
				should.not.exist(err);
				should(res).have.property('success');
				return done();
			});
		});
	});
});

Current Tags

  • 0.0.7                                ...           latest (6 months ago)

8 Versions

  • 0.0.7                                ...           6 months ago
  • 0.0.6                                ...           6 months ago
  • 0.1.0                                ...           a year ago
  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (7)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |