1.0.4 • Published 8 years ago

slettest v1.0.4

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

slettest

sletjs with supertest for ava or mocha

NPM version Build codecov.io js-standard-style

Usages

var slettest = require('slettest')
var app = require('./app')

test.cb("slettest()", t => {
  slettest(app)
    .get("/")
    .expect(200, function (err, res) {
      t.ifError(err)
      var userId = res.body.id;
      t.is(res.text, 'Hello Koa', 'res.text == Hello Koa')
      t.end()
    });
});

with generator

test('yield slettest()', function * (t) {
  let res = yield slettest(app)
    .get('/')

  t.is(200, res.status)
  t.is(res.text, 'Hello Koa', 'res.text == Hello Koa')
})

with async/await

test('async slettest()', async (t) => {
  let res = await slettest(app)
    .get('/')

  t.is(200, res.status)
  t.is(res.text, 'Hello Koa', 'res.text == Hello Koa')
})

Test

$ npm test

with watch mode

npm test -- -w 

Document

see http://visionmedia.github.io/superagent/

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago