0.1.1 • Published 9 years ago

tastespoon v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

TasteSpoon

Circle CI Dependency Status devDependency Status

Micro infrastracture behavior testing framework inspired by Infrataster.

Concept

  • NPM/CommonJS based plugin system
  • Pluggable with any JavaScript testing framework
  • Mocha integration is ready

Usage

$ npm install tastespoon --save-dev

Running with Docker and Mocha

$ npm install mocha tastespoon --save-dev
$ docker run -t -i -d -p 8000:80 nginx
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)
            })
        })
    })
})
$ mocha test/http_test.js

Mocha Integration

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)
            })
        })
    })
})
$ mocha -u tastespoon/mocha test/http_test.js