@sebspark/promise-cache 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -73,12 +73,13 @@ var createLocalMemoryClient = () => {
73
73
 
74
74
  // src/persistor.ts
75
75
  var CACHE_CLIENT = import_redis.createClient;
76
+ var isTestRunning = process.env.NODE_ENV === "test";
76
77
  var Persistor = class {
77
78
  client = null;
78
79
  redis;
79
80
  constructor(options) {
80
81
  const { redis, onError, onSuccess } = options;
81
- if (redis) {
82
+ if (redis && !isTestRunning) {
82
83
  this.redis = redis;
83
84
  } else {
84
85
  CACHE_CLIENT = createLocalMemoryClient;
package/dist/index.mjs CHANGED
@@ -42,12 +42,13 @@ var createLocalMemoryClient = () => {
42
42
 
43
43
  // src/persistor.ts
44
44
  var CACHE_CLIENT = createClient;
45
+ var isTestRunning = process.env.NODE_ENV === "test";
45
46
  var Persistor = class {
46
47
  client = null;
47
48
  redis;
48
49
  constructor(options) {
49
50
  const { redis, onError, onSuccess } = options;
50
- if (redis) {
51
+ if (redis && !isTestRunning) {
51
52
  this.redis = redis;
52
53
  } else {
53
54
  CACHE_CLIENT = createLocalMemoryClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebspark/promise-cache",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",