Skip to content

Commit

Permalink
Fix: don't use the cache file when testing (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed May 10, 2024
1 parent 967d2ed commit 2418458
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/igir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export default class Igir {
this.logger.trace('disabling the file cache');
FileCache.disable();
}
const cachePath = this.options.getCachePath() ?? Constants.GLOBAL_CACHE_FILE;
const cachePath = process.env.NODE_ENV !== 'test'
? this.options.getCachePath() ?? Constants.GLOBAL_CACHE_FILE
: undefined;
if (cachePath !== undefined) {
this.logger.trace(`setting the file cache path to '${cachePath}'`);
FileCache.loadFile(cachePath);
Expand Down

0 comments on commit 2418458

Please sign in to comment.