Skip to content

Commit

Permalink
refactor: add disable search api default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Atix committed Sep 16, 2021
1 parent f7f6b42 commit 2c8560a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -39,7 +39,7 @@ export const parseEnvironment = (): Environment => {
CARDANO_NODE_PATH: existingFileValidator(),
GENESIS_SHELLEY_PATH: existingFileValidator(),
CARDANO_NODE_SOCKET_PATH: str(),
DISABLE_SEARCH_API: bool()
DISABLE_SEARCH_API: bool({ default: false })
});
let topologyFile: TopologyConfig;
try {
Expand Down
3 changes: 2 additions & 1 deletion cardano-rosetta-server/test/e2e/environment-parser.test.ts
Expand Up @@ -49,7 +49,8 @@ describe('Environment parser test', () => {
process.env.BIND_ADDRESS = previousAddress;
});
test('Should throw an error if a field is expected to be a valid boolean but its not', () => {
const previousDisableSeachApi = process.env.DISABLE_SEARCH_API;
const previousDisableSeachApi =
process.env.DISABLE_SEARCH_API === undefined ? 'false' : process.env.DISABLE_SEARCH_API;
process.env.DISABLE_SEARCH_API = 'invalidBoolean';
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: number | undefined): never => {
throw new Error(code?.toString());
Expand Down

0 comments on commit 2c8560a

Please sign in to comment.