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 8728edb commit 8d6db7bCopy full SHA for 8d6db7b
tests/fixtures/helper.js
@@ -21,9 +21,22 @@
21
/**
22
* Throws an error if called.
23
*/
24
- helper.shouldNotGetCalled = function shouldNotGetCalled() {
25
- throw new Error('This function should not have gotten called.');
26
- };
+ helper.shouldNotGetCalled = function shouldNotGetCalled(done) {
+ var err = new Error('This function should not have gotten called.');
+ if (typeof done === 'function') {
27
+ return function(err2) {
28
+ if (err2 instanceof Error) {
29
+ done(err2);
30
+ }
31
+ else {
32
+ done(err);
33
34
35
36
37
+ throw err;
38
39
+ };
40
41
42
* Tests the {@link $RefParser.resolve} method,
@@ -73,7 +86,7 @@
73
86
74
87
done();
75
88
})
76
- .catch(helper.shouldNotGetCalled);
89
+ .catch(helper.shouldNotGetCalled(done));
77
90
}
78
91
};
79
92
0 commit comments