Skip to content
Merged
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
39 changes: 21 additions & 18 deletions e2e/src/smoke-tests/create-workspace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,29 @@ describe('smoke test - create-workspace', () => {
let projectRoot: string;
let gitConfigDir: string;

beforeEach(async () => {
if (existsSync(targetDir)) {
rmSync(targetDir, { force: true, recursive: true });
}
ensureDirSync(targetDir);
beforeEach(
async () => {
if (existsSync(targetDir)) {
rmSync(targetDir, { force: true, recursive: true });
}
ensureDirSync(targetDir);

// Isolate git config so the preset detects an "Amazonian" email without
// touching the user's real git config.
gitConfigDir = mkdtempSync(join(tmpdir(), 'nx-e2e-gitconfig-'));
writeFileSync(
join(gitConfigDir, 'global'),
'[user]\n\temail = e2e-test@amazon.com\n\tname = E2E Test\n',
);
// Empty file so no system git config (e.g. an @example.com email) leaks
// in and masks the amazon.com email above.
writeFileSync(join(gitConfigDir, 'system'), '');
// Isolate git config so the preset detects an "Amazonian" email without
// touching the user's real git config.
gitConfigDir = mkdtempSync(join(tmpdir(), 'nx-e2e-gitconfig-'));
writeFileSync(
join(gitConfigDir, 'global'),
'[user]\n\temail = e2e-test@amazon.com\n\tname = E2E Test\n',
);
// Empty file so no system git config (e.g. an @example.com email) leaks
// in and masks the amazon.com email above.
writeFileSync(join(gitConfigDir, 'system'), '');

// Non-interactive workspace to re-run the preset generator inside.
projectRoot = await createTestWorkspace(pkgMgr, targetDir, 'e2e-test');
});
// Non-interactive workspace to re-run the preset generator inside.
projectRoot = await createTestWorkspace(pkgMgr, targetDir, 'e2e-test');
},
10 * 60 * 1000,
);
afterEach(() => {
if (gitConfigDir && existsSync(gitConfigDir)) {
rmSync(gitConfigDir, { force: true, recursive: true });
Expand Down
Loading