Open Eoksni opened 6 years ago
I know doctests are supposed to be simple, but when one needs to match against objects, it is getting not pretty.
/** * @example * transition(newgame(), 'playerTwo') * // => { state: 'normal', playerOne: 'love', playerTwo: 15 } */
For the first part of assert I can do
/** * @example * (function() { * * const game = newgame(); * return transition(game, 'playerTwo'); * * })() * // => { state: 'normal', playerOne: 'love', playerTwo: 15 } */
so that is kinda multiline, although its not very pretty.
But the result object needs to be written in one line :(
@yamadapc Would a PR be welcome?
Sure a PR would be welcome
I know doctests are supposed to be simple, but when one needs to match against objects, it is getting not pretty.
For the first part of assert I can do
so that is kinda multiline, although its not very pretty.
But the result object needs to be written in one line :(