Skip to content

Commit a98c30a

Browse files
Simply error messagw
1 parent 40131ed commit a98c30a

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

test/e2e/lib/helpers/browser.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ export interface BrowserLog {
3535
timestamp: number
3636
}
3737

38-
// Salesforce generates console errors we cannot control
39-
const SALESFORCE_DEV_MODE_LOG_MESSAGES = [
40-
'Unsupported WebVital metrics',
41-
'Failed to load resource: the server responded with a status of 404 ()',
42-
]
4338
const IGNORE_LOG_MESSAGES = [
4439
'Ignoring unsupported entryTypes:',
4540
'Layout was forced before the page was fully loaded.',
46-
...SALESFORCE_DEV_MODE_LOG_MESSAGES,
41+
// Salesforce generates console errors we cannot control
42+
'O11Y Error {name: Error, message: Unsupported WebVital metrics',
4743
]
4844

4945
export class BrowserLogsManager {

test/e2e/lib/helpers/salesforceApp.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { spawnSync } from 'node:child_process'
22
import { resolve } from 'node:path'
33

44
const repositoryRoot = resolve(__dirname, '../../../..')
5+
const salesforceCliPackage = '@salesforce/cli@2.139.6'
56

67
export const salesforceLwcBundlePath = resolve(
78
repositoryRoot,
@@ -11,12 +12,15 @@ export const salesforceLwcBundlePath = resolve(
1112
// Check if the Salesforce org is configured
1213
export function getSalesforceConfig(): { targetOrg: string; isConfigured: boolean } {
1314
const targetOrg = process.env.SF_TARGET_ORG ?? 'sf-lwc-ci'
14-
const isConfigured =
15-
spawnSync('sf', ['org', 'display', '--target-org', targetOrg], {
16-
encoding: 'utf8',
17-
cwd: repositoryRoot,
18-
}).status === 0
19-
return { targetOrg, isConfigured }
15+
const args = ['org', 'display', '--target-org', targetOrg]
16+
const options = { encoding: 'utf8' as const, cwd: repositoryRoot }
17+
18+
let result = spawnSync('sf', args, options)
19+
if (result.error && (result.error as NodeJS.ErrnoException).code === 'ENOENT') {
20+
result = spawnSync('yarn', ['dlx', '-p', salesforceCliPackage, 'sf', ...args], options)
21+
}
22+
23+
return { targetOrg, isConfigured: result.status === 0 }
2024
}
2125

2226
// Build the URL to open in the test browser

0 commit comments

Comments
 (0)