Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ jobs:
- 8
- 10
- 12
- 14
exclude:
# Temporarily excludes node 12 on windows
# Wait for https://github.com/nodejs/node/issues/34514
# Excludes nodejs v12 and v14 on windows
# https://github.com/nodejs/node/issues/34514
# It was patched in nodejs v15+.
- os: windows-latest
node: 12
- os: windows-latest
node: 14

steps:
- name: Clone repository
Expand Down
13 changes: 11 additions & 2 deletions lib/bypass.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ exports = module.exports = function bypass(fn) {
try {
result = fn();
} finally {
if (result && typeof result.finally === 'function') {
result.finally(enable);
if (result && typeof result.then === 'function') {
result.then(
r => {
enable();
return r;
},
err => {
enable();
throw err;
}
);
} else {
enable();
}
Expand Down
Loading