1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 20:27:37 +00:00
Files
TypeScript-Node-Starter/test/contact.test.ts
Peter Blazejewicz 3414ceca45 Migrate TSLint to ESLint. Closes #209
This commit rewrites linting support in the project to be based solely
on the ESLint as advised by the TSLint tool authors:
https://medium.com/palantir/tslint-in-2019-1a144c2317a9

The migration is based on default, recommended settings for TypeScript
in ESLint and is expected to be updated in future to better fit project
goals.

All references has been updated and replaced with relevant ESLint
context:

- dependencies migration from TSLint to ESLint
- VSCode configuration changes to support ESLint exension
- VSCode extensions recommendation changes
- `.eslintrc` and `.eslintignore` configuration files added
- all error level problems in the source files are covered by this
  migration

Thanks!
2019-07-15 23:14:51 +02:00

25 lines
648 B
TypeScript

import request from "supertest";
import app from "../src/app";
import { expect} from "chai";
describe("GET /contact", () => {
it("should return 200 OK", (done) => {
request(app).get("/contact")
.expect(200, done);
});
});
describe("POST /contact", () => {
it("should return false from assert when no message is found", (done) => {
request(app).post("/contact")
.field("name", "John Doe")
.field("email", "john@me.com")
.end(function(err, res) {
expect(res.error).to.be.false;
done();
})
.expect(302);
});
});