test: mock bull
This commit is contained in:
18
__mocks__/bull.js
Normal file
18
__mocks__/bull.js
Normal 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 });
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user