私はREST APIのテストケースを作成し始めました。以下はコードです。私は個々のテストケース(合格/不合格、テストケース名など)のステータスを取得していません。コマンドプロンプトでモカ試験実施|個々のテストケースのステータスはありません
**var supertest = require("supertest");
var should = require("should");
// This agent refers to PORT where program is runninng.
var server = supertest.agent("http://localhost:1337");
// UNIT test begin
describe("SAMPLE unit test",function(){
// #1 should return home page
it("should return login details",function(done){
// calling Login api
server
.post('/login')
.send({ loginid: "8787878787", password : "temp"})
.expect("Content-type",/json/)
.expect(200)
.end(function(err,res){
res.status.should.equal(200);
res.body.notFound.should.equal(false);
res.body.data.customerId.should.equal(20);
done();
});
});
it("should return no active user",function(done){
// calling home page api
server
.post('/login')
.send({ loginid: "8787878787", password : "temp1"})
.expect("Content-type",/json/)
.end(function(err,res){
res.body.notFound.should.equal(true);
done();
});
});
});**
これが出力されます:私は
コード行方不明です非常に些細な何かがあることを理解します。個々のテストケースのステータス(名前、 "it"ブロックに記述されているもの、各テストケースがどれくらいの時間を費やしたかなど)は表示されません。
2回(7s)
個々のテストケースのステータスを表示する方法を教えてください。
ありがとうございます!これは解決されました。 – Swapna