-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wasm): Ensure browser bundle exists before running tests (#4389)
The tests in our `wasm` package use the browser bundle, and therefore won't run if the bundle hasn't been built. #4074 added a warning for this situation. This improves that by actually building the missing bundles, ensuring the tests will always run.
- Loading branch information
1 parent
e52faa4
commit d53ed78
Showing
3 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
function ensureBrowserBundle() { | ||
const browserPackageDir = path.resolve(__dirname, '../../../browser'); | ||
if (!fs.existsSync(path.resolve(browserPackageDir, 'build/bundle.js'))) { | ||
// eslint-disable-next-line no-console | ||
console.warn('\nWARNING: Missing browser bundle. Bundle will be created before running wasm integration tests.'); | ||
execSync(`pushd ${browserPackageDir} && yarn build:bundle && popd`); | ||
} | ||
} | ||
|
||
ensureBrowserBundle(); |