theprogrammablemind 7.3.0 → 7.3.1

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 +9 -4
  2. package/package.json +33 -33
package/client.js CHANGED
@@ -1325,8 +1325,11 @@ const knowledgeModule = async ({
1325
1325
  } else if (args.test || args.testVerbose || args.testAllVerbose) {
1326
1326
  // TODO make test always a string
1327
1327
  if (typeof test === 'string') {
1328
- const l = (n) => {
1328
+ const l = (n, hasError) => {
1329
1329
  if (n === 0) {
1330
+ if (hasError) {
1331
+ process.exit(-1)
1332
+ }
1330
1333
  return
1331
1334
  }
1332
1335
  runTests(config, test, { debug: args.debug, testConfig: testConfig, verbose: args.testVerbose || args.testAllVerbose, stopAtFirstError: !args.testAllVerbose, beforeQuery, beforeTests, afterTests, beforeTest, afterTest }).then((results) => {
@@ -1335,6 +1338,7 @@ const knowledgeModule = async ({
1335
1338
  vimdiff(result.expected, result.actual)
1336
1339
  }
1337
1340
  }
1341
+ let newError = false
1338
1342
  if (results.length > 0) {
1339
1343
  let headerShown = false
1340
1344
  console.log('**************************** ERRORS ************************')
@@ -1346,7 +1350,7 @@ const knowledgeModule = async ({
1346
1350
  }
1347
1351
  console.log(' expected paraphrases', result.expected.paraphrases)
1348
1352
  console.log(' actual paraphrases ', result.actual.paraphrases)
1349
-
1353
+ newError = true
1350
1354
  headerShown = true
1351
1355
  }
1352
1356
  if (JSON.stringify(result.expected.responses) !== JSON.stringify(result.actual.responses)) {
@@ -1355,6 +1359,7 @@ const knowledgeModule = async ({
1355
1359
  }
1356
1360
  console.log(' expected responses ', result.expected.responses)
1357
1361
  console.log(' actual responses ', result.actual.responses)
1362
+ newError = true
1358
1363
  headerShown = true
1359
1364
  }
1360
1365
  }
@@ -1366,12 +1371,12 @@ const knowledgeModule = async ({
1366
1371
  console.log('**************************** ERRORS ************************')
1367
1372
  }
1368
1373
  // const contexts = { failures: results }
1369
- l(n - 1)
1374
+ l(n - 1, hasError || newError)
1370
1375
  }).catch((error) => {
1371
1376
  errorHandler(error)
1372
1377
  })
1373
1378
  }
1374
- l(args.count)
1379
+ l(args.count, false)
1375
1380
  } else {
1376
1381
  test()
1377
1382
  }
package/package.json CHANGED
@@ -8,17 +8,21 @@
8
8
  "natural language understanding",
9
9
  "chatbot"
10
10
  ],
11
- "devDependencies": {
12
- "@typescript-eslint/parser": "^4.28.4",
13
- "jest": "^26.6.3",
14
- "eslint": "^7.31.0",
15
- "eslint-plugin-node": "^11.1.0",
16
- "eslint-plugin-import": "^2.23.4",
17
- "eslint-plugin-promise": "^5.1.0",
18
- "eslint-config-standard": "^16.0.3",
19
- "@typescript-eslint/eslint-plugin": "^4.28.4"
11
+ "author": "dev@thinktelligence.com",
12
+ "dependencies": {
13
+ "sort-json": "^2.0.0",
14
+ "scriptjs": "^2.5.9",
15
+ "deep-equal": "^2.0.4",
16
+ "readline": "^1.3.0",
17
+ "json-diff": "^1.0.3",
18
+ "uuid": "^8.3.2",
19
+ "node-fetch": "^2.6.1",
20
+ "json-stable-stringify": "^1.0.1",
21
+ "fs": "0.0.1-security",
22
+ "base-64": "^1.0.0",
23
+ "lodash": "^4.17.20",
24
+ "underscore": "^1.13.1"
20
25
  },
21
- "name": "theprogrammablemind",
22
26
  "files": [
23
27
  "client.js",
24
28
  "index.js",
@@ -34,32 +38,28 @@
34
38
  "src/generators.js",
35
39
  "src/semantics.js"
36
40
  ],
37
- "version": "7.3.0",
38
- "author": "dev@thinktelligence.com",
39
- "dependencies": {
40
- "base-64": "^1.0.0",
41
- "json-stable-stringify": "^1.0.1",
42
- "uuid": "^8.3.2",
43
- "readline": "^1.3.0",
44
- "scriptjs": "^2.5.9",
45
- "node-fetch": "^2.6.1",
46
- "fs": "0.0.1-security",
47
- "sort-json": "^2.0.0",
48
- "deep-equal": "^2.0.4",
49
- "lodash": "^4.17.20",
50
- "underscore": "^1.13.1",
51
- "json-diff": "^1.0.3"
52
- },
53
- "main": "index.js",
54
- "license": "ISC",
41
+ "name": "theprogrammablemind",
55
42
  "scripts": {
56
43
  "test:watch": "npm run test -- --watch",
44
+ "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO",
45
+ "to": "node node_modules/.bin/jest --runInBand -t NEO",
57
46
  "lint:fix": "eslint \"**/*.js\" --fix",
58
47
  "test": "jest --config ./jest.config.json",
59
- "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO",
60
- "lint": "eslint \"**/*.js\"",
61
48
  "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json",
62
- "to": "node node_modules/.bin/jest --runInBand -t NEO",
63
- "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO"
64
- }
49
+ "lint": "eslint \"**/*.js\"",
50
+ "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO"
51
+ },
52
+ "devDependencies": {
53
+ "eslint-config-standard": "^16.0.3",
54
+ "@typescript-eslint/eslint-plugin": "^4.28.4",
55
+ "eslint-plugin-promise": "^5.1.0",
56
+ "@typescript-eslint/parser": "^4.28.4",
57
+ "jest": "^26.6.3",
58
+ "eslint": "^7.31.0",
59
+ "eslint-plugin-node": "^11.1.0",
60
+ "eslint-plugin-import": "^2.23.4"
61
+ },
62
+ "license": "ISC",
63
+ "main": "index.js",
64
+ "version": "7.3.1"
65
65
  }