chore(vite): undo test logs and re-enable tests (#17573)

This commit is contained in:
Katerina Skroumpelou 2023-06-13 18:48:49 +03:00 committed by GitHub
parent 7abcb816b5
commit 0374db54fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 35 deletions

View File

@ -42,31 +42,23 @@ export function newProject({
name = uniq('proj'),
packageManager = getSelectedPackageManager(),
} = {}): string {
console.log('Testing_B 1');
console.log('Testing_B packageManager', packageManager);
try {
const projScope = 'proj';
console.log('Testing_B 2');
if (!directoryExists(tmpBackupProjPath())) {
console.log('Testing_B 3');
runCreateWorkspace(projScope, {
preset: 'empty',
packageManager,
});
console.log('Testing_B 4');
// Temporary hack to prevent installing with `--frozen-lockfile`
if (isCI && packageManager === 'pnpm') {
console.log('Testing_B 5');
updateFile(
'.npmrc',
'prefer-frozen-lockfile=false\nstrict-peer-dependencies=false\nauto-install-peers=true'
);
}
console.log('Testing_B 6');
// TODO(jack): we should tag the projects (e.g. tags: ['package']) and filter from that rather than hard-code packages.
const packages = [
`@nx/angular`,
@ -90,32 +82,22 @@ export function newProject({
`@nx/expo`,
];
packageInstall(packages.join(` `), projScope);
console.log('Testing_B 7');
// stop the daemon
execSync(`${getPackageManagerCommand().runNx} reset`, {
cwd: `${e2eCwd}/proj`,
stdio: isVerbose() ? 'inherit' : 'pipe',
});
console.log('Testing_B 8');
moveSync(`${e2eCwd}/proj`, `${tmpBackupProjPath()}`);
console.log('Testing_B 9');
}
projName = name;
console.log('Testing_B 10');
copySync(`${tmpBackupProjPath()}`, `${tmpProjPath()}`);
console.log('Testing_B 11');
if (isVerbose()) {
console.log('Testing_B 12');
logInfo(`NX`, `E2E created a project: ${tmpProjPath()}`);
}
console.log('Testing_B 13');
if (packageManager === 'pnpm') {
console.log('Testing_B 14');
execSync(getPackageManagerCommand().install, {
cwd: tmpProjPath(),
stdio: 'pipe',
@ -123,10 +105,8 @@ export function newProject({
encoding: 'utf-8',
});
}
console.log('Testing_B 15');
return projScope;
} catch (e) {
console.log('Testing_B 16');
logError(`Failed to set up project for e2e tests.`, e.message);
throw e;
}

View File

@ -28,29 +28,17 @@ describe('Vite Plugin', () => {
describe('Vite on React apps', () => {
describe('convert React webpack app to vite using the vite:configuration generator', () => {
beforeEach(() => {
console.log('Testing_A 1');
proj = newProject();
console.log('Testing_A proj', proj);
console.log('Testing_A 2');
runCLI(`generate @nx/react:app ${myApp} --bundler=webpack`);
console.log('Testing_A 3');
runCLI(`generate @nx/vite:configuration ${myApp}`);
console.log('Testing_A 4');
});
afterEach(() => cleanupProject());
it('should serve application in dev mode with custom options', async () => {
console.log('Testing_A 5');
const port = 4212;
console.log('Testing_A 6');
const p = await runCommandUntil(
`run ${myApp}:serve --port=${port} --https=true`,
(output) => {
console.log('Testing_A 7');
return (
output.includes('Local:') &&
output.includes(`:${port}`) &&
@ -59,12 +47,9 @@ describe('Vite Plugin', () => {
}
);
try {
console.log('Testing_A 8');
await promisifiedTreeKill(p.pid, 'SIGKILL');
await killPorts(port);
} catch (e) {
console.log('Testing_A 9');
console.log('Testing_A e', e);
// ignore
}
}, 200_000);