December 2016
Intermediate to advanced
136 pages
2h 58m
English
© Caio Ribeiro Pereira 2016
Caio Ribeiro Pereira, Building APIs with Node.js , 10.1007/978-1-4842-2442-7_9
Caio Ribeiro Pereira1
(1)São Vicente - SP, São Paulo, Brazil
Continuing the test implementation, now focus next on writing some tests for the resources: tasks and users.
To test the endpoints of a task’s resource, we are going to cheat the JWT authentication . After all, it will be necessary to correctly test the results of this resource and also the other resources that involves user authentication. To start, let’s create the structure for the tasks test.
Create the file test/routes/tasks.js with the following code.
1 import jwt from "jwt-simple";23 describe("Routes: Tasks", ...