Skip to content

Commit 6963dd3

Browse files
Merge pull request #266 from tcet-opensource/eslint-hotfix
eslint fixes
2 parents e4adcec + c876e2e commit 6963dd3

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

test/routes/infrastructure.test.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
import { jest } from '@jest/globals';
2-
import request from 'supertest';
3-
import app from '#app'; // Update this import based on your app's structure
4-
import connector from '#models/databaseUtil'; // Update this import
5-
import infrastructureModel from '#models/infrastructure'; // Update this import
1+
import { jest } from "@jest/globals"; // eslint-disable-line import/no-extraneous-dependencies
2+
import request from "supertest";
3+
import app from "#app"; // Update this import based on your app"s structure
4+
import connector from "#models/databaseUtil"; // Update this import
5+
import infrastructureModel from "#models/infrastructure"; // Update this import
66

7-
jest.mock('#util');
7+
jest.mock("#util");
88

99
let server;
1010
let agent;
1111

1212
beforeAll((done) => {
1313
server = app.listen(5000, () => {
1414
agent = request.agent(server);
15-
connector.set('debug', false);
15+
connector.set("debug", false);
1616
done();
1717
});
1818
});
1919

2020
function cleanUp(callback) {
2121
infrastructureModel
2222
.remove({
23-
name: 'Building A',
24-
type: 'Office',
25-
wing: 'East',
23+
name: "Building A",
24+
type: "Office",
25+
wing: "East",
2626
floor: 3,
2727
capacity: 100,
2828
})
2929
.then(() => {
3030
connector.disconnect((DBerr) => {
31-
if (DBerr) console.log('Database disconnect error: ', DBerr);
31+
if (DBerr) console.log("Database disconnect error: ", DBerr);
3232
server.close((serverErr) => {
3333
if (serverErr) console.log(serverErr);
3434
callback();
@@ -41,12 +41,12 @@ afterAll((done) => {
4141
cleanUp(done);
4242
});
4343

44-
describe('Infrastructure API', () => {
45-
it('should create infrastructure', async () => {
46-
const response = await agent.post('/infrastructure/add').send({
47-
name: 'Building A',
48-
type: 'Office',
49-
wing: 'East',
44+
describe("Infrastructure API", () => {
45+
it("should create infrastructure", async () => {
46+
const response = await agent.post("/infrastructure/add").send({
47+
name: "Building A",
48+
type: "Office",
49+
wing: "East",
5050
floor: 3,
5151
capacity: 100,
5252
});
@@ -55,38 +55,38 @@ describe('Infrastructure API', () => {
5555
expect(response.body.res).toMatch(/added user/);
5656
});
5757

58-
describe('after adding infrastructure', () => {
58+
describe("after adding infrastructure", () => {
5959
beforeEach(async () => {
60-
await agent.post('/infrastructure/add').send({
61-
name: 'Building A',
62-
type: 'Office',
63-
wing: 'East',
60+
await agent.post("/infrastructure/add").send({
61+
name: "Building A",
62+
type: "Office",
63+
wing: "East",
6464
floor: 3,
6565
capacity: 100,
6666
});
6767
});
6868

6969
afterEach(async () => {
7070
await infrastructureModel.remove({
71-
name: 'Building A',
72-
type: 'Office',
73-
wing: 'East',
71+
name: "Building A",
72+
type: "Office",
73+
wing: "East",
7474
floor: 3,
7575
capacity: 100,
7676
});
7777
});
7878

79-
it('should read infrastructure', async () => {
79+
it("should read infrastructure", async () => {
8080
const response = await agent
81-
.post('/infrastructure/list')
82-
.send({ name: 'Building A' });
81+
.post("/infrastructure/list")
82+
.send({ name: "Building A" });
8383
expect(response.body.res).not.toBeNull();
8484
});
8585

86-
it('should update infrastructure', async () => {
86+
it("should update infrastructure", async () => {
8787
const response = await agent
88-
.post('/infrastructure/update')
89-
.send({ name: 'Building A' }, { capacity: 150 });
88+
.post("/infrastructure/update")
89+
.send({ name: "Building A" }, { capacity: 150 });
9090

9191
expect(response.status).toBe(200);
9292
expect(response.body.res).toMatch(/updated infrastructure/);

0 commit comments

Comments
 (0)