mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Release v1.0.0 🎉
This commit is contained in:
11
test/mocks/mockNotification.js
Normal file
11
test/mocks/mockNotification.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
_tmpStore: {},
|
||||
|
||||
send: (serviceName, payload) => {
|
||||
this._tmpStore = { serviceName, payload };
|
||||
},
|
||||
|
||||
get: () => {
|
||||
return this._tmpStore;
|
||||
}
|
||||
};
|
||||
5
test/mocks/mockStats.js
Normal file
5
test/mocks/mockStats.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
setLastScrape: () => {
|
||||
/*noop*/
|
||||
}
|
||||
};
|
||||
27
test/mocks/mockStore.js
Normal file
27
test/mocks/mockStore.js
Normal file
@@ -0,0 +1,27 @@
|
||||
class Store {
|
||||
constructor(name) {
|
||||
this._name = name;
|
||||
this._db = {};
|
||||
}
|
||||
|
||||
get warmup() {
|
||||
this._db = {};
|
||||
return new Promise(resolve => resolve());
|
||||
}
|
||||
|
||||
set knownListings(value) {
|
||||
if (!Array.isArray(value)) throw Error('Not a valid array');
|
||||
return new Promise(resolve => {
|
||||
this._db[this._name] = value;
|
||||
resolve(value);
|
||||
});
|
||||
}
|
||||
|
||||
get bla() {}
|
||||
|
||||
get knownListings() {
|
||||
return this._db[this._name] || [];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Store;
|
||||
Reference in New Issue
Block a user