mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-08 16:17:37 +00:00
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!
This commit is contained in:
@@ -2,8 +2,8 @@ import request from "supertest";
|
||||
import app from "../src/app";
|
||||
|
||||
describe("GET /api", () => {
|
||||
it("should return 200 OK", () => {
|
||||
return request(app).get("/api")
|
||||
.expect(200);
|
||||
});
|
||||
it("should return 200 OK", () => {
|
||||
return request(app).get("/api")
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,8 +2,8 @@ import request from "supertest";
|
||||
import app from "../src/app";
|
||||
|
||||
describe("GET /random-url", () => {
|
||||
it("should return 404", (done) => {
|
||||
request(app).get("/reset")
|
||||
.expect(404, done);
|
||||
});
|
||||
it("should return 404", (done) => {
|
||||
request(app).get("/reset")
|
||||
.expect(404, done);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
import request from "supertest";
|
||||
import app from "../src/app";
|
||||
|
||||
const chai = require("chai");
|
||||
const expect = chai.expect;
|
||||
import { expect} from "chai";
|
||||
|
||||
describe("GET /contact", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request(app).get("/contact")
|
||||
.expect(200, done);
|
||||
});
|
||||
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);
|
||||
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);
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -2,8 +2,8 @@ import request from "supertest";
|
||||
import app from "../src/app";
|
||||
|
||||
describe("GET /", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request(app).get("/")
|
||||
.expect(200, done);
|
||||
});
|
||||
it("should return 200 OK", (done) => {
|
||||
request(app).get("/")
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,34 +1,32 @@
|
||||
import request from "supertest";
|
||||
import app from "../src/app";
|
||||
|
||||
const chai = require("chai");
|
||||
const expect = chai.expect;
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("GET /login", () => {
|
||||
it("should return 200 OK", () => {
|
||||
return request(app).get("/login")
|
||||
.expect(200);
|
||||
});
|
||||
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);
|
||||
});
|
||||
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();
|
||||
});
|
||||
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();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user