Skip to content

Commit

Permalink
fix(wasm): Check for browser bundle existence before running tests (#…
Browse files Browse the repository at this point in the history
…4074)

As of #4048, it's more likely that one might try to run the full test suite without having built the browser bundle. Since the wasm tests rely on it, this adds a check before they run, along with an error message letting the user know why things aren't working.
  • Loading branch information
lobsterkatie authored Oct 19, 2021
1 parent b1ca2eb commit 111ea28
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/wasm/test/integration.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/* global page, window */
const fs = require('fs');
const path = require('path');

const HOST = `http://localhost:${process.env.PORT}`;

if (!fs.existsSync(path.resolve(__dirname, '../../browser/build/bundle.js'))) {
throw new Error(
'ERROR: No browser bundle found in `packages/browser/build/`. Please run `yarn build` in the browser package before running wasm tests.',
);
}

describe('Wasm', () => {
it('captured exception should include modified frames and debug_meta attribute', async () => {
await page.goto(HOST);
Expand Down

0 comments on commit 111ea28

Please sign in to comment.