-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(generator-helper): Attempt to reduce generatorHanlder test
flakiness `generatorHandler` waits for 200ms and if generator have not failed in this time considers it a success. This is results in quite flaky behaviour on CI. For now, attempting to overcome it by introducing the executable that fails faster. Ideally, the error handling logic of `generatorHandler` needs changing: it should explicictly confirm succesful startup.
- Loading branch information
Showing
2 changed files
with
3 additions
and
13 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
14 changes: 2 additions & 12 deletions
14
packages/generator-helper/src/__tests__/invalid-executable
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 |
---|---|---|
@@ -1,14 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
// let's provoke this to fail by requiring an unexisting module | ||
require('modulethatdoesnotexist/something') | ||
|
||
const { generatorHandler } = require('../generatorHandler') | ||
|
||
generatorHandler({ | ||
async onGenerate() { | ||
await new Promise((r) => { | ||
setTimeout(r, 500) | ||
}) | ||
}, | ||
}) | ||
console.error('something terrible happened') | ||
process.exit(1) |