
js.StorageStub.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xtest Show documentation
Show all versions of xtest Show documentation
A TDD framework to make coding drven by specifications easier
class StorageStub {
map = new Map();
get length() {
return this.map.size;
};
key(index) {
let value = Array.from(this.map.keys())[index];
return (value === undefined) ? null : value;
}
getItem(key) {
let value = this.map.get(key);
return (value === undefined) ? null : value;
}
setItem(key, value) {
this.map.set(key, value);
}
removeItem(key) {
this.map.delete(key);
}
clear() {
this.map.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy