Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
feat: Allow ability to modify the config in test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalanamini committed Oct 29, 2022
1 parent 1380a62 commit a468df8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import content from "#src/config";
import {
ConfigI,
DEFAULT,
ENV,
SERVER_PROTOCOL,
ConfigI,
ServerConfigI,
SubdomainConfigI,
JsonConfigI,
JsonpConfigI,
QueryConfigI,
ProxyConfigI,
QueryConfigI,
SERVER_PROTOCOL,
ServerConfigI,
SubdomainConfigI,
} from "#src/constants";
import content from "#src/config";
import Joi from "joi";
import os from "os";

Expand Down Expand Up @@ -84,8 +84,7 @@ function freeze<T extends Record<string, any>>(obj: T): T {
return Object.freeze(obj);
}

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const CONFIG = freeze(config!);
const CONFIG: ConfigI = config?.env === ENV.TEST ? config : freeze(config);

/* ------------------------- Exports ------------------------- */

Expand Down

0 comments on commit a468df8

Please sign in to comment.