From f1d63048c63aa660c4ede73fba8b9e7751bd8bb4 Mon Sep 17 00:00:00 2001 From: Misumi Rize Date: Mon, 22 Jun 2015 20:30:36 +0900 Subject: [PATCH] v0.1.0 release --- README.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 12 ++++++++- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3193fed --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +TasteSpoon +========== + +[![Circle CI](https://circleci.com/gh/MisumiRize/tastespoon.svg?style=svg)](https://circleci.com/gh/MisumiRize/tastespoon) +[![Dependency Status](https://david-dm.org/MisumiRize/tastespoon.svg)](https://david-dm.org/MisumiRize/tastespoon) +[![devDependency Status](https://david-dm.org/MisumiRize/tastespoon/dev-status.svg)](https://david-dm.org/MisumiRize/tastespoon#info=devDependencies) + +Micro infrastracture behavior testing framework inspired by [Infrataster](http://infrataster.net/). + +## Concept + +* NPM/CommonJS based plugin system +* Pluggable with any JavaScript testing framework +* Mocha integration is ready + +## Usage + +```bash +$ npm install tastespoon --save-dev +``` + +## Running with Docker and Mocha + +```bash +$ npm install mocha tastespoon --save-dev +$ docker run -t -i -d -p 8000:80 nginx +``` + +```javascript +import TasteSpoon from "tastespoon" +import assert from "assert" + +TasteSpoon.define("http", "127.0.0.1") + +let server = TasteSpoon.server("http") +describe(server, () => { + + let http = TasteSpoon.http("http://example.com:8000") + describe(http, () => { + it("returns 200", () => { + return http(server).result().then((response) => { + assert(response.statusCode == 200) + }) + }) + }) +}) +``` + +```bash +$ mocha test/http_test.js +``` + +## Mocha Integration + +```javascript +import TasteSpoon from "tastespoon" +import assert from "assert" +let http = TasteSpoon.http + +TasteSpoon.define("http", "127.0.0.1") + +describe(server("http"), () => { + describe(http("http://example.com:8000"), () => { + it("returns 200", () => { + return this.result().then((response) => { + assert(response.statusCode == 200) + }) + }) + }) +}) +``` + +```bash +$ mocha -u tastespoon/mocha test/http_test.js +``` diff --git a/package.json b/package.json index abcbcf9..d74c484 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,23 @@ { "name": "tastespoon", "version": "0.1.0", - "description": "", + "description": "Infrastructure behavior testing framework", "main": "index.js", + "files": [ + "lib", + "index.js", + "mocha.js", + "tastespoon.d.ts" + ], "scripts": { "prepublish": "tsd reinstall && tsd rebundle && tsc -m commonjs -t ES5 --outDir lib src/index.ts src/mocha.ts", "test:integration": "mocha --compilers ts:espower-typescript/guess test/integration/*.test.ts" }, "author": "Rize MISUMI", + "repository": { + "type": "git", + "url": "https://github.com/MisumiRize/tastespoon" + }, "license": "MIT", "devDependencies": { "espower-typescript": "^0.1.0",