Could you try to use sinon instead of building such a small mock?
@yurenju Could you help him?