Completing the first spec

We now have the boilerplate code and database structures needed to further complete our spec:

 'use strict'; var request = require('request'); var dbSession = require('../../src/backend/dbSession.js'); var resetDatabase = require('../resetDatabase.js'); var async = require('async'); describe('The API', function () { it('should respond to a GET request at /api/keywords/', function (done) { var expected = { "_items": [ {'id': 1, 'value': 'Aubergine', 'categoryID': 1}, {'id': 2, 'value': 'Onion', 'categoryID': 1}, {'id': 3, 'value': 'Knife', 'categoryID': 2} ] }; async.series( [ function(callback) { resetDatabase(dbSession, callback); }, function(callback) { dbSession.insert( 'keyword', {'value': 'Aubergine', 'categoryID': ...

Get The Node Craftsman Book now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.