initial commit

This commit is contained in:
2021-09-06 11:08:59 +02:00
parent 1ebac1dd27
commit fa63d7bb60
4 changed files with 3685 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
const request = require("supertest");
const app = require("../index");
describe("Get route", () => {
it("page should return hello world", async () => {
const res = await request(app).get("/");
expect(res.statusCode).toEqual(200);
expect(res.body).toEqual("Hello world");
});
});
afterAll(async () => {
await app.close();
});
+12
View File
@@ -0,0 +1,12 @@
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.status(200).json("Hello world");
});
module.exports = app.listen(process.env.PORT || 4000, () =>
console.log(`Running on http://localhost:4000`)
);
+3636
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"name": "jenkins-test",
"version": "1.0.0",
"description": "a node app to learn jenkins",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://gitea.thuispc.dynu.net/steven/jenkins-test.git"
},
"author": "steven",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"jest": "^27.1.0",
"supertest": "^6.1.6"
}
}