fix(appium): fix behavior of ReadonlyMap to be compatible with Map
MODIFY
packages/appium/lib/utils.js
packages/appium/lib/utils.js
@@ -235,8 +235,8 @@ class ReadonlyMap extends Map {
return super.set(key, value);
}
- delete (key) {
- throw new Error(`${key} cannot be deleted`);
+ delete () {
+ return false;
}
clear () {

MODIFY
packages/appium/test/utils-specs.js
packages/appium/test/utils-specs.js
@@ -226,7 +226,7 @@ describe('utils', function () {
it('should not allow deletion', function () {
const map = new ReadonlyMap([['foo', 'bar']]);
- (() => map.delete('foo')).should.throw();
+ map.delete('foo').should.be.false;
});
it('should not allow clearing', function () {

fix(appium): fix behavior of ReadonlyMap to be compatible with Map