-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from deecewan/async-dangerfile
[WIP] initial implementation to handle async
- Loading branch information
Showing
9 changed files
with
150 additions
and
5 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
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
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,15 @@ | ||
/*eslint-disable */ | ||
|
||
import 'babel-polyfill'; | ||
|
||
const asyncAction = () => new Promise(res => { | ||
setTimeout(() => { | ||
warn('Async Function'); | ||
res(); | ||
}, 50); | ||
}); | ||
|
||
schedule(async () => { | ||
await asyncAction(); | ||
warn('After Async Function'); | ||
}); |
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,8 @@ | ||
/*eslint-disable */ | ||
|
||
schedule(done => { | ||
setTimeout(() => { | ||
warn('Scheduled a callback'); | ||
done(); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
source/runner/_tests/fixtures/__DangerfileMultiScheduled.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,27 @@ | ||
/*eslint-disable */ | ||
|
||
schedule(new Promise((res) => { | ||
setTimeout(() => { | ||
fail('Asynchronous Failure'); | ||
res(); | ||
}, 100); | ||
})); | ||
|
||
schedule(new Promise((res) => { | ||
warn('Asynchronous Warning'); | ||
res(); | ||
})); | ||
|
||
schedule(new Promise((res) => { | ||
setTimeout(() => { | ||
message('Asynchronous Message'); | ||
res(); | ||
}, 10); | ||
})); | ||
|
||
schedule(new Promise((res) => { | ||
setTimeout(() => { | ||
markdown('Asynchronous Markdown'); | ||
res(); | ||
}, 50); | ||
})); |
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,8 @@ | ||
/*eslint-disable */ | ||
|
||
schedule(new Promise((res) => { | ||
setTimeout(() => { | ||
warn('Asynchronous Warning'); | ||
res(); | ||
}, 10); | ||
})); |