Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jan 14, 2025
1 parent c48c4c6 commit 5e9b347
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 22 deletions.
40 changes: 29 additions & 11 deletions e2e-tests/tests/angular-17.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,38 @@ async function runWizardOnAngularProject(projectDir: string, integration: Integr
'Where are your build artifacts located?',
));

const sourcemapsConfiguredPromise = wizardInstance.waitForOutput(
'Added a sentry:sourcemaps script to your package.json',
);

const sourcemapsConfigured = sourcemapsPrompted &&
(await wizardInstance.sendStdinAndWaitForOutput(
["./dist", KEYS.ENTER],
'Added a sentry:sourcemaps script to your package.json.',
), {
const buildScriptPromptedPromise = wizardInstance.waitForOutput(
'Do you want to automatically run the sentry:sourcemaps script after each production build?',
);

const optionalArtifactsNotFoundPromise = wizardInstance.waitForOutput(
'We couldn\'t find artifacts',
{
optional: true,
});
timeout: 5000
}
);

if (sourcemapsPrompted) {
wizardInstance.sendStdin("./dist");
wizardInstance.sendStdin(KEYS.ENTER);
}

const optionalArtifactsNotFoundPrompted = sourcemapsPrompted && await optionalArtifactsNotFoundPromise;

if (optionalArtifactsNotFoundPrompted) {
wizardInstance.sendStdin(KEYS.DOWN);
wizardInstance.sendStdin(KEYS.ENTER);
}

const sourcemapsConfigured = sourcemapsPrompted && await sourcemapsConfiguredPromise;
const buildScriptPrompted = sourcemapsConfigured && await buildScriptPromptedPromise;


const buildScriptPrompted = sourcemapsConfigured &&
(await wizardInstance.sendStdinAndWaitForOutput(
[KEYS.ENTER],
'Do you want to automatically run the sentry:sourcemaps script after each production build?',
));

const defaultBuildCommandPrompted = buildScriptPrompted &&
(await wizardInstance.sendStdinAndWaitForOutput(
Expand Down
38 changes: 27 additions & 11 deletions e2e-tests/tests/angular-19.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,36 @@ async function runWizardOnAngularProject(projectDir: string, integration: Integr
'Where are your build artifacts located?',
));

const sourcemapsConfiguredPromise = wizardInstance.waitForOutput(
'Added a sentry:sourcemaps script to your package.json',
);

const sourcemapsConfigured = sourcemapsPrompted &&
(await wizardInstance.sendStdinAndWaitForOutput(
["./dist", KEYS.ENTER],
'Added a sentry:sourcemaps script to your package.json.',
), {
const buildScriptPromptedPromise = wizardInstance.waitForOutput(
'Do you want to automatically run the sentry:sourcemaps script after each production build?',
);

const optionalArtifactsNotFoundPromise = wizardInstance.waitForOutput(
'We couldn\'t find artifacts',
{
optional: true,
});
timeout: 5000
}
);

const buildScriptPrompted = sourcemapsConfigured &&
(await wizardInstance.sendStdinAndWaitForOutput(
[KEYS.ENTER],
'Do you want to automatically run the sentry:sourcemaps script after each production build?',
));
if (sourcemapsPrompted) {
wizardInstance.sendStdin("./dist");
wizardInstance.sendStdin(KEYS.ENTER);
}

const optionalArtifactsNotFoundPrompted = sourcemapsPrompted && await optionalArtifactsNotFoundPromise;

if (optionalArtifactsNotFoundPrompted) {
wizardInstance.sendStdin(KEYS.DOWN);
wizardInstance.sendStdin(KEYS.ENTER);
}

const sourcemapsConfigured = sourcemapsPrompted && await sourcemapsConfiguredPromise;
const buildScriptPrompted = sourcemapsConfigured && await buildScriptPromptedPromise;

const defaultBuildCommandPrompted = buildScriptPrompted &&
(await wizardInstance.sendStdinAndWaitForOutput(
Expand Down

0 comments on commit 5e9b347

Please sign in to comment.