Last active
December 18, 2015 20:29
-
-
Save rehno-lindeque/5840412 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = _ = require "lodash" | |
# Define the function you want to test | |
# (This is a lodash extension: Structured map over an object using a corresponding dictionary of functions) | |
_.mixin mapStruct: (obj, fns, defaultFn) -> | |
defaultFn = defaultFn ? if _.isFunction fns then fns else _.identity | |
_.zipObject (for k,v of obj then [k, (fns?[k] ? defaultFn) v, k]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
test-example.coffee.unit
:The result gets written into
test-example.spec.unit
file:The testing framework does
git diff test-example.spec.unit
and reports an error if there is any differences. To update a test specification, simplygit commit test-example.spec.unit
.