Skip to content

Commit

Permalink
fix: Resolve build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mikestreety committed Feb 20, 2025
1 parent e32aeff commit 9e9ccbb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/_legacy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ export interface Site {
// A Playwright project
project?: object
}

// The additional configuration for a project
export interface ProjectConfig {
testsToFind: string;
}
5 changes: 2 additions & 3 deletions src/_legacy/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Site } from './types.js';
import type { ProjectConfig } from './../types.js';
import type { Site, ProjectConfig } from './types.js';
import type { Project, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test';

import { getEnv } from './../utils.js';
Expand All @@ -11,7 +10,7 @@ export function deprecationNotice()
{
if(process.env.PWF_DEPRECATION_V1 !== 'true') {
console.warn('⚠️ Legacy functionality detected');
console.warn('The configuration is using deprectaed functionality which will be removed in the next version.');
console.warn('The configuration is using deprecated functionality which will be removed in the next version.');
console.warn('Please follow the migration guide to upgrade');
console.warn('[INSERT URL]');

Expand Down
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export const normalizeUrl = (url: string) => url.endsWith('/') ? url.slice(0, -1
*/
export function generateDynamicTestProjects(projects: string[]): Project[]
{
const firstMobile: string | undefined = projects.find(name => devices[name].isMobile);
const firstDesktop: string | undefined = projects.find(name => !devices[name].isMobile);

const firstMobile: string | undefined = projects.find(name => devices[name] ? devices[name].isMobile : undefined);
const firstDesktop: string | undefined = projects.find(name => devices[name] ? !devices[name].isMobile : undefined);

return projects.map((device, index) => convertDeviceToPlaywrightProject(
device,
Expand Down

0 comments on commit 9e9ccbb

Please sign in to comment.