Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluebird long stack traces integration test
- Loading branch information
1 parent
3c8b1be
commit 61101d9
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
const Promise = require('bluebird'); | ||
Promise.longStackTraces(); | ||
|
||
module.exports = Promise; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"ava": { | ||
"require": "./enable-trace.js" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import test from '../../../'; | ||
import Promise from './enable-trace'; | ||
|
||
|
||
// This promise throwing pattern was used in bluebird documentation for long stack traces | ||
// http://bluebirdjs.com/docs/api/promise.longstacktraces.html | ||
test(async t => { | ||
const resolve = await Promise.resolve().then(function outer() { | ||
return Promise.resolve().then(function inner() { | ||
return Promise.resolve().then(function evenMoreInner() { | ||
a.b.c.d() | ||
}).catch(function catcher(e) { | ||
throw e.stack | ||
}); | ||
}); | ||
}); | ||
}); |