UNPKG

@hazae41/phobos

Version:

Modern and minimalist testing library for the web

21 lines (18 loc) 421 B
import { Call } from './call.mjs'; function spy(closure) { return new Spyer(closure); } class Spyer { closure; constructor(closure) { this.closure = closure; } calls = new Array(); call(...params) { const result = this.closure(...params); this.calls.push(new Call(params, result)); return result; } } export { Spyer, spy }; //# sourceMappingURL=spyer.mjs.map