Skip to content

Instantly share code, notes, and snippets.

@uiur
Created September 10, 2015 01:11
Show Gist options
  • Save uiur/8bda7f5b77c3d5160a55 to your computer and use it in GitHub Desktop.
Save uiur/8bda7f5b77c3d5160a55 to your computer and use it in GitHub Desktop.
test.register(function hoge () {
})
register = function (name, fn) {
function add (name, fn) {
Test.prototype[name] = function () {
this._assert()
return fn()
}
}
add(name, fn)
Object.keys(fn).forEach((key) => add(key, fn))
}
test((t) => {
t.hoge() // t.assertCount++
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment