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
Peter Blazejewicz 1b71586efa Update source and dependency to work with TypeScript 2.7. Closes #81
The commit brings compatibility with new features introduced in TypeScript 2.7.
The one with most impact on this project is ES6/ECMAScript module compatibility layer
added in 2.7 enabled in tsconfig.json for this project.
This allowed to rewrite source files to use shorted, better imports everywhere and
also use default exports.

To make project more aligned with updated TypeScript all the NPM depenendencies has been
updated making sure that everything works as expected and tests pass.

Thanks for the project!

Thanks!
2018-02-20 22:02:53 +01:00

35 lines
762 B
TypeScript

import request from "supertest";
import app from "../src/app";
const chai = require("chai");
const 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();
});
});
});