Skip to content

Commit

Permalink
build(deps-dev): remove @faker-js/faker (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Nov 7, 2022
1 parent 5643cf1 commit a1b24a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 49 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@faker-js/faker": "^7.6.0",
"autocannon": "^7.10.0",
"eslint": "^8.26.0",
"eslint-config-airbnb-base": "^15.0.0",
Expand Down
45 changes: 14 additions & 31 deletions src/config/config.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { faker } = require("@faker-js/faker/locale/en_GB");
const fs = require("fs/promises");
const glob = require("glob");
const path = require("upath");
Expand Down Expand Up @@ -150,18 +149,14 @@ describe("Configuration", () => {
});

test("Should return values according to environment variables - HTTPS (SSL cert) enabled, HTTP2 enabled, and OCR enabled", async () => {
const HOST = faker.internet.ip();
const PORT = faker.datatype.number();
const HOST = "0.0.0.0";
const PORT = 443;
const REQ_BODY_MAX_BYTES = 100000000;
const HTTPS_SSL_CERT_PATH =
"./test_resources/test_ssl_cert/server.cert";
const HTTPS_SSL_KEY_PATH = "./test_resources/test_ssl_cert/server.key";
const HTTPS_HTTP2_ENABLED = true;
const LOG_LEVEL = faker.helpers.arrayElement([
"debug",
"warn",
"silent",
]);
const LOG_LEVEL = "trace";
const LOG_ROTATION_DATE_FORMAT = "YYYY-MM";
const LOG_ROTATION_FILENAME = "./test_resources/test-log1-%DATE%.log";
const LOG_ROTATION_FREQUENCY = "custom";
Expand Down Expand Up @@ -279,17 +274,13 @@ describe("Configuration", () => {
});

test("Should return values according to environment variables - HTTPS (PFX cert) enabled and HTTP2 enabled", async () => {
const HOST = faker.internet.ip();
const PORT = faker.datatype.number();
const HOST = "0.0.0.0";
const PORT = 443;
const HTTPS_PFX_FILE_PATH =
"./test_resources/test_ssl_cert/server.cert"; // Not an actual PFX file
const HTTPS_PFX_PASSPHRASE = faker.lorem.word();
const HTTPS_PFX_PASSPHRASE = "TestPassphrase";
const HTTPS_HTTP2_ENABLED = true;
const LOG_LEVEL = faker.helpers.arrayElement([
"debug",
"warn",
"silent",
]);
const LOG_LEVEL = "trace";

Object.assign(process.env, {
HOST,
Expand Down Expand Up @@ -362,20 +353,16 @@ describe("Configuration", () => {
])(
"Should return values according to environment variables - $testName",
async ({ envVariables, expected }) => {
const HOST = faker.internet.ip();
const PORT = faker.datatype.number();
const HOST = "0.0.0.0";
const PORT = 80;
const { CORS_ORIGIN } = envVariables;
const CORS_ALLOWED_HEADERS =
"Accept, Authorization, Content-Type, Origin, X-Requested-With";
const CORS_ALLOW_CREDENTIALS =
envVariables?.CORS_ALLOW_CREDENTIALS || "";
const CORS_EXPOSED_HEADERS = "Location";
const CORS_MAX_AGE = 10;
const LOG_LEVEL = faker.helpers.arrayElement([
"debug",
"warn",
"silent",
]);
const LOG_LEVEL = "trace";

Object.assign(process.env, {
HOST,
Expand Down Expand Up @@ -412,7 +399,7 @@ describe("Configuration", () => {
testName: "invalid PFX file path",
envVariables: {
HTTPS_PFX_FILE_PATH: "./test_resources/test_ssl_cert/error.pfx",
HTTPS_PFX_PASSPHRASE: faker.lorem.word(),
HTTPS_PFX_PASSPHRASE: "TestPassphrase",
},
},
{
Expand All @@ -424,17 +411,13 @@ describe("Configuration", () => {
},
},
])("Should throw error if $testName", async ({ envVariables }) => {
const HOST = faker.internet.ip();
const PORT = faker.datatype.number();
const HOST = "0.0.0.0";
const PORT = 443;
const HTTPS_SSL_KEY_PATH = envVariables?.HTTPS_SSL_KEY_PATH || "";
const HTTPS_SSL_CERT_PATH = envVariables?.HTTPS_SSL_CERT_PATH || "";
const HTTPS_PFX_FILE_PATH = envVariables?.HTTPS_PFX_FILE_PATH || "";
const HTTPS_PFX_PASSPHRASE = envVariables?.HTTPS_PFX_PASSPHRASE || "";
const LOG_LEVEL = faker.helpers.arrayElement([
"debug",
"warn",
"silent",
]);
const LOG_LEVEL = "trace";

Object.assign(process.env, {
HOST,
Expand Down

0 comments on commit a1b24a7

Please sign in to comment.