apemantest

Test utilify for apeman.

Usage no npm install needed!

<script type="module">
  import apemantest from 'https://cdn.skypack.dev/apemantest';
</script>

README

apemantest

Build Status Code Climate Code Coverage npm Version JS Standard

Test utilify for apeman.

Installation

$ npm install apemantest --save-dev

Usage

/**
 * Test case for signRoute.
 * Runs with mocha.
 */

'use strict'

const apemantest = require('apemantest')
const request = apemantest.newRequest()
const { assert, co } = apemantest

describe('sign-route', function suite () {
  this.timeout(4000)

  let server = apemantest.testServer('api', {
    configuration: require('../Apemanfile.js')
  })
  before(() => co(function * () {
    yield apemantest.resetDB()
    yield server.start()
  }))

  after(() => co(function * () {
    yield server.stop()
  }))

  it('API Test', () => co(function * () {
    let res = yield request({
      url: `${server.baseUrl}/sign/signup`,
      method: 'POST',
      form: { /* ... */ }
    })
    /* ... */
  }))
})

/* global describe, before, after, it */

License

This software is released under the MIT License.

Links