O'Reilly logo

Advanced Express Web Application Development by Andrew Keig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Feature: Create a project

As a vision user
I want to create a new project
So that I can monitor the activity of multiple repositories

Let's add a test to our existing set of tests for our feature Create a project. This resource will POST a project to the route /project and return a 201 Created status code. The following test: ./test/project.js is the 201 Created test.

Tip

This book will not document the full set of tests for a feature. Please refer to the source code for the full set of tests.

In this example, SuperTest executes an end function that returns a response; this allows us to check the headers and body of the response.

describe('when creating a new resource /project', function(){ var project = { name: "new project" , user: login.user , token: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required