Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Oct 11, 2023
1 parent 976cd80 commit 24a6f9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"all": true,
"extension": [".mts"],
"reporter": ["text", "lcov"]
}
6 changes: 3 additions & 3 deletions test/functional/controllers/monitoring.test.mts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { expect } from 'chai';
import express, { type Express } from 'express';
import type { Express } from 'express';
import request from 'supertest';
import type { HealthChecker } from '@cloudnative/health-connect';
import { healthChecker, monitoringController } from '../../../src/controllers/monitoring.mjs';
import { createApp } from '../../../src/server.mjs';

describe('MonitoringController', function () {
let app: Express;

before(function () {
app = express();
app.disable('x-powered-by');
app = createApp();
app.use('/monitoring', monitoringController());
});

Expand Down
6 changes: 3 additions & 3 deletions test/functional/middleware/error.test.mts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { expect } from 'chai';
import express, { type Express } from 'express';
import type { Express } from 'express';
import request, { type Response as SuperTestResponse } from 'supertest';
import { errorMiddleware } from '@myrotvorets/express-microservice-middlewares';
import { BadImageError, BadResponseError, FaceXError, HttpError, NetworkError } from '@myrotvorets/facex';
import { environment } from '../../../src/lib/environment.mjs';
import { UploadError } from '../../../src/lib/uploaderror.mjs';
import { faceXErrorHandlerMiddleware } from '../../../src/middleware/error.mjs';
import { createApp } from '../../../src/server.mjs';

describe('faceXErrorHandlerMiddleware', function () {
let app: Express;
Expand All @@ -24,8 +25,7 @@ describe('faceXErrorHandlerMiddleware', function () {

environment();

app = express();
app.disable('x-powered-by');
app = createApp();
});

afterEach(function () {
Expand Down
6 changes: 3 additions & 3 deletions test/functional/middleware/upload.test.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { expect } from 'chai';
import express, { type Express } from 'express';
import type { Express } from 'express';
import request from 'supertest';
import { errorMiddleware } from '@myrotvorets/express-microservice-middlewares';
import { type ErrorCode, MulterError } from 'multer';
import { uploadErrorHandlerMiddleware } from '../../../src/middleware/upload.mjs';
import { environment } from '../../../src/lib/environment.mjs';
import { createApp } from '../../../src/server.mjs';

describe('uploadErrorHandlerMiddleware', function () {
let app: Express;
Expand All @@ -23,8 +24,7 @@ describe('uploadErrorHandlerMiddleware', function () {

environment();

app = express();
app.disable('x-powered-by');
app = createApp();
});

afterEach(function () {
Expand Down

0 comments on commit 24a6f9e

Please sign in to comment.