Skip to content

Commit 5b5251d

Browse files
committed
fix test flake
1 parent f9d0456 commit 5b5251d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/build-reporter-plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ function getBuildOptions (configOptions: BuildReporterConfig) {
4646
provider: configOptions.sourceControl?.provider,
4747
repository: configOptions.sourceControl?.repository,
4848
revision: configOptions.sourceControl?.revision,
49-
buildApiRootUrl: configOptions?.endpoint,
50-
logLevel: configOptions?.logLevel
49+
buildApiRootUrl: configOptions.endpoint,
50+
logLevel: configOptions.logLevel
5151
}
5252

5353
for (const [key, value] of Object.entries(buildOptions)) {

test/build-reporter-plugin.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ describe('BugsnagBuildReporterPlugin', () => {
111111
const originalCreateBuild = vi.mocked(BugsnagCLI.CreateBuild)
112112
originalCreateBuild.mockImplementationOnce(() => Promise.reject(new Error('Bugsnag CLI error')))
113113

114-
await build(viteConfig)
114+
try {
115+
await build(viteConfig)
116+
} catch {
117+
// Ignore random errors with copying files, unrelated to the test
118+
}
115119

116120
expect(mockLogger.info).toHaveBeenCalledWith('[BugsnagBuildReporterPlugin] creating build for version "1.2.3" using the bugsnag-cli')
117121
expect(mockLogger.info).not.toHaveBeenCalledWith('[BugsnagBuildReporterPlugin] Build reported successfully')

0 commit comments

Comments
 (0)