Explorar o código

chore: Handle timing out tests

Michael Bromley hai 3 meses
pai
achega
8690fda09e

+ 1 - 11
packages/cli/e2e/cli-migrate.e2e-spec.ts

@@ -1,20 +1,10 @@
-import { afterEach, beforeAll, describe, expect, it } from 'vitest';
+import { afterEach, describe, expect, it } from 'vitest';
 
 import { CliTestProject, createProblematicTsConfig, createTestProject } from './cli-test-utils';
 
 describe('CLI Migrate Command E2E', () => {
     let testProject: CliTestProject;
 
-    beforeAll(() => {
-        try {
-            // eslint-disable-next-line @typescript-eslint/no-var-requires
-            const { execSync } = require('child_process');
-            execSync('npm run build', { cwd: __dirname + '/..', stdio: 'inherit' });
-        } catch (error) {
-            throw new Error('Failed to build CLI before running e2e tests. Run "npm run build" first.');
-        }
-    });
-
     afterEach(() => {
         if (testProject) {
             testProject.cleanup();

+ 2 - 1
packages/cli/e2e/cli-test-utils.ts

@@ -46,7 +46,7 @@ export function createTestProject(projectName: string = 'test-project'): CliTest
 
     // Create basic vendure-config.ts
     const vendureConfig = `
-import { VendureConfig } from '@vendure/core';
+import { VendureConfig, NoopLogger } from '@vendure/core';
 
 export const config: VendureConfig = {
     apiOptions: {
@@ -54,6 +54,7 @@ export const config: VendureConfig = {
         adminApiPath: 'admin-api',
         shopApiPath: 'shop-api',
     },
+    logger: new NoopLogger(),
     authOptions: {
         tokenMethod: ['bearer', 'cookie'],
         superadminCredentials: {

+ 1 - 1
packages/dashboard/vite/tests/path-alias.spec.ts

@@ -6,7 +6,7 @@ import { compile } from '../utils/compiler.js';
 import { debugLogger, noopLogger } from '../utils/logger.js';
 
 describe('detecting plugins using tsconfig path aliases', () => {
-    it('should detect plugins using tsconfig path aliases', { timeout: 10_000 }, async () => {
+    it('should detect plugins using tsconfig path aliases', { timeout: 60_000 }, async () => {
         const tempDir = join(__dirname, './__temp/path-alias');
         await rm(tempDir, { recursive: true, force: true });