test: mock bull

This commit is contained in:
Tom Moor 2020-11-26 21:11:35 -08:00
parent 8bddc1b338
commit ac349b40f5
1 changed files with 18 additions and 0 deletions

18
__mocks__/bull.js Normal file
View File

@ -0,0 +1,18 @@
// @flow
export default class Queue {
name: string;
constructor(name) {
this.name = name;
}
process = (fn) => {
console.log(`Registered function ${this.name}`);
this.processFn = fn;
};
add = (data) => {
console.log(`Running ${this.name}`);
return this.processFn({ data });
};
}