Skip to content

Commit

Permalink
randomly cause generation failures
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Feb 9, 2024
1 parent 86c5895 commit 1122215
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/sandbox/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ const addStorybook = async ({
const tmpDir = directory();

try {
if (Math.random() < 0.2) {
throw new Error('Blip Bloop random error in addStorybook');
}
await copy(beforeDir, tmpDir);

const packageManager = JsPackageManagerFactory.getPackageManager({ force: 'yarn1' }, tmpDir);
Expand Down Expand Up @@ -178,6 +181,9 @@ const runGenerators = async (
// where as others are very picky about what directories can be called. So we need to
// handle different modes of operation.
try {
if (Math.random() < 0.2) {
throw new Error('Blip Bloop random error when executing before-script');
}
if (script.includes('{{beforeDir}}')) {
const scriptWithBeforeDir = script.replaceAll('{{beforeDir}}', BEFORE_DIR_NAME);
await runCommand(
Expand Down

0 comments on commit 1122215

Please sign in to comment.