slettest

1.0.4 • Public • Published

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/

Readme

Keywords

none

Package Sidebar

Install

npm i slettest

Weekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • zhaoxingyue
  • zhangyuang
  • langshu