Last active
January 18, 2016 21:33
-
-
Save ecowden/e01f9928f93d45536557 to your computer and use it in GitHub Desktop.
Super simple example using `co`
This file contains hidden or 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
const assert = require('assert') | |
const co = require('co') | |
return co(function* () { | |
let a = yield getDataAsync() | |
let b = yield getDataAsync() | |
let c = yield getDataAsync() | |
let actual = yield averageAsync([a, b, c]) | |
let expected = (a + b + c) / 3 | |
assert.equal(actual, expected) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment