mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-08 23:49:11 +00:00
initial commit
This commit is contained in:
12
test/api.test.ts
Normal file
12
test/api.test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as supertest from "supertest";
|
||||
import {default as app} from "../src/server";
|
||||
|
||||
const request = supertest("http://localhost:8000");
|
||||
|
||||
describe("GET /api", () => {
|
||||
it("should return 200 OK", () => {
|
||||
request
|
||||
.get("/api")
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
9
test/app.test.ts
Normal file
9
test/app.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as supertest from "supertest";
|
||||
const request = supertest("http://localhost:8000");
|
||||
|
||||
describe("GET /random-url", () => {
|
||||
it("should return 404", (done) => {
|
||||
request.get("/reset")
|
||||
.expect(404, done);
|
||||
});
|
||||
});
|
||||
9
test/contact.test.ts
Normal file
9
test/contact.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as supertest from "supertest";
|
||||
const request = supertest("http://localhost:8000");
|
||||
|
||||
describe("GET /contact", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request.get("/contact")
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
9
test/home.test.ts
Normal file
9
test/home.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as supertest from "supertest";
|
||||
const request = supertest("http://localhost:8000");
|
||||
|
||||
describe("GET /", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request.get("/")
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
16
test/user.test.ts
Normal file
16
test/user.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as supertest from "supertest";
|
||||
const request = supertest("http://localhost:8000");
|
||||
|
||||
describe("GET /login", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request.get("/login")
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GET /signup", () => {
|
||||
it("should return 200 OK", (done) => {
|
||||
request.get("/signup")
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user