npm

Need private packages and team management tools?Check out npm Orgs. »

todomvc-api

0.2.1 • Public • Published

TodoMVC API

Validate your TodoMVC backend

TodoMVC API contains the apiblueprint spec and a dredd wrapper to run validation tests against TasteStack TodoMVC backends.

Install

$ npm install --save-dev todomvc-api

Use with gulp.js and Express

var todomvc = require('todomvc-api');
 
gulp.task('test', function (done) {
 
    // Start your API server.
    var server = app.listen(8080, function () {
 
        // Run the TodoMVC validation test suite.
        todomvc.validate(function (err, stats) {
 
            // Shut down the server & pass a helpful message to Gulp.
            server.close(function () {
                if (stats && (stats.errors || stats.failures)) {
                    done('api validation failed');
                    return;
                }
 
                done(err);
            });
        });
    });
});

API

validate([url], callback)

url

Type: string Default: http://localhost:8080

The base location to ping your API.

callback

Required Type: function

This callback is executed with the results of our test suite against your API server.

Keywords

none

install

npm i todomvc-api

Downloadsweekly downloads

9

version

0.2.1

license

Apache 2.0

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability