Tracyboehrer/get value parity (#4639)
* DialogStateManager.getValue does not throw for missing Scope (DotNet parity) * Corrected DialogStateManager test --------- Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
This commit is contained in:
Родитель
6782cddb33
Коммит
7ceb965f36
|
@ -118,7 +118,8 @@ export class DialogStateManager {
|
|||
// Get memory scope to search over
|
||||
const scope = this.getMemoryScope(segments[0].toString());
|
||||
if (scope == undefined) {
|
||||
throw new Error(`DialogStateManager.getValue: a scope of '${segments[0]}' wasn't found.`);
|
||||
console.warn(`DialogStateManager.getValue: a scope of '${segments[0]}' wasn't found for '${pathExpression}'.`);
|
||||
return returnDefault();
|
||||
}
|
||||
|
||||
// Search over path
|
||||
|
|
|
@ -229,7 +229,7 @@ describe('Dialog State Manager', function () {
|
|||
});
|
||||
|
||||
it('raise an error if getValue() called with an invalid scope.', function () {
|
||||
assert.throws(() => this.dc.state.getValue('foo.bar'));
|
||||
assert.strictEqual(this.dc.state.getValue('foo.bar'), undefined);
|
||||
});
|
||||
|
||||
it('raise an error if setValue() called with missing path.', function () {
|
||||
|
|
Загрузка…
Ссылка в новой задаче