私は API を構築しており、モカとスーパーテストでテストしようとしています。
私はこのコードで POST 呼び出しを正しくテストしています:
it("Should generate a PDF based on the given data using API", function(done) {
request(app)
.post("/api/document/print")
.send({tplName: "default", tplData: { title: "Testee", p1: "paragraph"}})
.expect(200, done);
});
しかし、このコードで GET リクエストをテストしようとすると:
it("Should get HTML of the selected template", function(done) {
request(app)
.get("/api/template/default/html")
.expect(200, done);
});
アプリを実行して Chrome で試してみると、正しい応答 (200) が得られます。
私は何を間違っていますか?