api-endpoint-test

Test your API endpoints with ease!

Usage no npm install needed!

<script type="module">
  import apiEndpointTest from 'https://cdn.skypack.dev/api-endpoint-test';
</script>

README

Test your API endpoints with ease!

api-endpoint-test is a lightweight mapper of api-endpoint that allows for easier testing.

var should = require('should'),
    $ = require('api-endpoint-test');

describe('User', function() {
    it('can be created', function(done) {
        var user = {
            email: 'test@test.com',
            password: 'secret'
        };

        $(require('../users/create.js'), {
            payload: user
        }, function(err, response) {
            response.should.have.property('email', user.email);
            done();
        });
    });
});