@adaptivestone/framework 3.4.2 → 3.4.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tests/setup.js +11 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "main": "src/index.js",
6
6
  "engines": {
package/tests/setup.js CHANGED
@@ -1,13 +1,14 @@
1
+ const path = require('node:path');
1
2
  /* eslint-disable jest/require-top-level-describe */
2
3
  const { MongoMemoryReplSet } = require('mongodb-memory-server');
3
4
  const mongoose = require('mongoose');
4
5
 
5
6
  let mongoMemoryServerInstance;
6
- const path = require('path');
7
+
7
8
  const redis = require('redis');
8
9
  const Server = require('../server');
9
10
 
10
- const clearRadisNamespace = require('../helpers/redis/clearNamespace');
11
+ const clearRedisNamespace = require('../helpers/redis/clearNamespace');
11
12
 
12
13
  jest.setTimeout(1000000);
13
14
  beforeAll(async () => {
@@ -29,6 +30,7 @@ beforeAll(async () => {
29
30
  models: process.env.TEST_FOLDER_MODELS || path.resolve('./models'),
30
31
  emails:
31
32
  process.env.TEST_FOLDER_EMAIL ||
33
+ process.env.TEST_FOLDER_EMAILS ||
32
34
  path.resolve('./services/messaging/email/templates'),
33
35
  locales: process.env.TEST_FOLDER_LOCALES || path.resolve('./locales'),
34
36
  commands: process.env.TEST_FOLDER_COMMANDS || path.resolve('./commands'),
@@ -81,9 +83,13 @@ afterEach(async () => {
81
83
  const { url, namespace } = global.server.getConfig('redis');
82
84
  const redisClient = redis.createClient({ url });
83
85
 
84
- await redisClient.connect();
85
- await clearRadisNamespace(redisClient, namespace);
86
- await redisClient.disconnect();
86
+ try {
87
+ await redisClient.connect();
88
+ await clearRedisNamespace(redisClient, namespace);
89
+ await redisClient.disconnect();
90
+ } catch (err) {
91
+ // that ok. No redis connection
92
+ }
87
93
  }
88
94
  });
89
95