theprogrammablemind 7.3.5-beta.21 → 7.3.5-beta.23

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/client.js +5 -4
  2. package/package.json +3 -3
package/client.js CHANGED
@@ -29,10 +29,6 @@ const setupLibs = () => {
29
29
  }
30
30
  }
31
31
 
32
- if (isJest()) {
33
- setupLibs()
34
- }
35
-
36
32
  const ask = (config) => (asks) => {
37
33
  for (let ask of asks) {
38
34
  config.addMotivation({
@@ -255,6 +251,7 @@ const writeTestFile = (fn, tests) => {
255
251
  }
256
252
 
257
253
  const writeTest = (fn, query, objects, generated, paraphrases, responses, contexts, associations, metadata, config, saveDeveloper) => {
254
+ setupLibs()
258
255
  let tests = []
259
256
  if (fs.existsSync(fn)) {
260
257
  tests = JSON.parse(fs.readFileSync(fn))
@@ -1121,6 +1118,10 @@ const knowledgeModule = async ({
1121
1118
  const isProcess = require.main === moduleFromJSFile
1122
1119
  const testConfig = test
1123
1120
 
1121
+ if (isProcess && isJest()) {
1122
+ setupLibs()
1123
+ }
1124
+
1124
1125
  // remove test only stuff
1125
1126
  if (!isProcess) {
1126
1127
  config.config.operators = config.config.operators.filter( (operator) => {
package/package.json CHANGED
@@ -10,9 +10,9 @@
10
10
  "eslint": "^7.31.0"
11
11
  },
12
12
  "scripts": {
13
- "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO",
13
+ "to:debug": "node inspect node_modules/.bin/jest --runInBand -t ONE23",
14
14
  "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json",
15
- "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO",
15
+ "tod": "node inspect node_modules/.bin/jest --runInBand -t ONE23",
16
16
  "lint:fix": "eslint \"**/*.js\" --fix",
17
17
  "lint": "eslint \"**/*.js\"",
18
18
  "to": "node node_modules/.bin/jest --runInBand -t NEO",
@@ -60,6 +60,6 @@
60
60
  "json-stable-stringify": "^1.0.1",
61
61
  "node-fetch": "^2.6.1"
62
62
  },
63
- "version": "7.3.5-beta.21",
63
+ "version": "7.3.5-beta.23",
64
64
  "license": "ISC"
65
65
  }