Skip to content

Commit

Permalink
Fix the storage.get method in tests to handle null argument
Browse files Browse the repository at this point in the history
Instead of returning a simple copy of the entire storage, it now correctly iterates over all keys in the store and applies the '_get_one' method to each key, returning an object with all the data.
  • Loading branch information
modos189 committed Jul 28, 2023
1 parent 2a94923 commit 994fd87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default {
*/
async get(keys) {
if (keys === null) {
return { ...store }; // Return a copy of all data in the store
const data = {};
for (const key in store) {
data[key] = this._get_one(key);
}
return data;
}
keys = this._one_to_array(keys);
if (Array.isArray(keys)) {
Expand Down

0 comments on commit 994fd87

Please sign in to comment.