wingbot 3.50.1 → 3.51.0
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/package.json +4 -3
- package/src/Tester.js +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wingbot",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.51.0",
|
|
4
4
|
"description": "Enterprise Messaging Bot Conversation Engine",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"eslint": "^8.11.0",
|
|
41
41
|
"eslint-config-airbnb": "^19.0.4",
|
|
42
42
|
"eslint-plugin-import": "^2.25.4",
|
|
43
|
-
"eslint-plugin-jsdoc": "^
|
|
43
|
+
"eslint-plugin-jsdoc": "^39.7.5",
|
|
44
44
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
45
45
|
"eslint-plugin-mocha": "^10.0.3",
|
|
46
46
|
"eslint-plugin-react": "^7.29.4",
|
|
47
47
|
"graphql-markdown": "^6.0.0",
|
|
48
|
-
"jsdoc-to-markdown": "^
|
|
48
|
+
"jsdoc-to-markdown": "^8.0.0",
|
|
49
49
|
"mocha": "^10.0.0",
|
|
50
50
|
"nyc": "^15.1.0",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@amplitude/ua-parser-js": "^0.7.31",
|
|
57
|
+
"deep-extend": "^0.6.0",
|
|
57
58
|
"form-data": "^4.0.0",
|
|
58
59
|
"graphql": "^15.8.0",
|
|
59
60
|
"jsonwebtoken": "^9.0.0",
|
package/src/Tester.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
const assert = require('assert');
|
|
7
|
+
const deepExtend = require('deep-extend');
|
|
7
8
|
const Processor = require('./Processor');
|
|
8
9
|
const Request = require('./Request');
|
|
9
10
|
const { MemoryStateStorage } = require('./tools');
|
|
@@ -372,14 +373,19 @@ class Tester {
|
|
|
372
373
|
* Assert, that state contains a subset of provided value
|
|
373
374
|
*
|
|
374
375
|
* @param {object} object
|
|
376
|
+
* @param {boolean} deep
|
|
375
377
|
* @example
|
|
376
378
|
*
|
|
377
379
|
* t.stateContains({ value: true });
|
|
378
380
|
*/
|
|
379
|
-
stateContains (object) {
|
|
381
|
+
stateContains (object, deep = false) {
|
|
380
382
|
const { state } = this.getState();
|
|
381
383
|
|
|
382
|
-
assert.deepEqual(
|
|
384
|
+
assert.deepEqual(
|
|
385
|
+
state,
|
|
386
|
+
deep ? deepExtend(state, object) : { ...state, ...object },
|
|
387
|
+
'Conversation state equals'
|
|
388
|
+
);
|
|
383
389
|
}
|
|
384
390
|
|
|
385
391
|
/**
|