Release v1.0.0 🎉

This commit is contained in:
Christian Kellner
2018-01-20 20:23:27 +01:00
commit c6cffe029d
33 changed files with 2168 additions and 0 deletions

View 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
View File

@@ -0,0 +1,5 @@
module.exports = {
setLastScrape: () => {
/*noop*/
}
};

27
test/mocks/mockStore.js Normal file
View 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;