We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a3a285 commit 3d1fb63Copy full SHA for 3d1fb63
test/promises.tests.js
@@ -165,6 +165,19 @@ test("forEachSeries", {
165
});
166
167
test("nfcall", {
168
+ "when function throws error then promise is rejected": function() {
169
+ return promises.nfcall(function(callback) {
170
+ throw new Error("failure");
171
+ }).then(
172
+ function(result) {
173
+ assert.fail("Expected rejection");
174
+ },
175
+ function(error) {
176
+ assert.strictEqual(error.message, "failure");
177
+ }
178
+ );
179
180
+
181
"when function calls callback with error then promise is rejected": function() {
182
return promises.nfcall(function(callback) {
183
callback(new Error("failure"));
0 commit comments