afterward
Execute an error-first callback upon resolution or rejection of a promise, and return the promise.
This makes it easier to write functions that support both callback and promise based async patterns.
example
var afterward = Promise = { var prom = { } return } // we can now use our fancy function either way...// with a callback: // or a promise
api
var afterward =
prom = afterward(prom [, cb])
Upon resolution or rejection of the promise prom
, execute the optional error-first style callback cb
. The promise prom
is returned.
errors
var UnknownError = UnknownError
UnknownError
The constructor function of the Error
object provided to callback cb
when the Promise prom
is rejected with no argument.
testing
npm test [--dot | --spec] [--phantom] [--grep=pattern]
Specifying --dot
or --spec
will change the output from the default TAP style.
Specifying --phantom
will cause the tests to run in the headless phantom browser instead of node.
Specifying --grep
will only run the test files that match the given pattern.
browser test
npm run browser-test
This will run the tests in all browsers (specified in .zuul.yml). Be sure to educate zuul first.
coverage
npm run coverage [--html]
This will output a textual coverage report. Including --html
will also open
an HTML coverage report in the default browser.