UNPKG

@hazae41/phobos

Version:

Modern and minimalist testing library for the web

24 lines (20 loc) 459 B
'use strict'; var call = require('./call.cjs'); 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.Call(params, result)); return result; } } exports.Spyer = Spyer; exports.spy = spy; //# sourceMappingURL=spyer.cjs.map