1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 16:17:37 +00:00
Files
TypeScript-Node-Starter/test/user.test.ts
Irene (XiangYi) Chen d080f39b86 coverage/chai support and some unit tests
1. added jest coverage support (#64)
2. added chai testing support
3. created new unit tests
2018-01-03 15:12:41 -08:00

35 lines
771 B
TypeScript

import * as request from "supertest";
import * as app from "../src/app";
var chai = require('chai');
var expect = chai.expect;
describe("GET /login", () => {
it("should return 200 OK", () => {
return request(app).get("/login")
.expect(200);
});
});
describe("GET /signup", () => {
it("should return 200 OK", () => {
return request(app).get("/signup")
.expect(200);
});
});
describe("POST /login", () => {
it("should return some defined error message with valid parameters", (done) => {
return request(app).post("/login")
.field("email", "john@me.com")
.field("password", "Hunter2")
.expect(302)
.end(function(err, res) {
expect(res.error).not.to.be.undefined;
done();
});
});
});