Skip to content

Commit

Permalink
fix package install
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Dec 20, 2024
1 parent 75b0412 commit e8247d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions js/web/test/e2e/exports/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ const treeKill = require('tree-kill');
*
* @param {string[]} packagesToInstall
*/
module.exports = async function main(PRESERVE) {
module.exports = async function main(PRESERVE, PACKAGES_TO_INSTALL) {
console.log('Running exports tests...');

// testcases/nextjs-default
{
const wd = path.join(__dirname, 'testcases/nextjs-default');
if (!PRESERVE) {
await runShellCmd('npm install ../../onnxruntime-common.tgz ../../onnxruntime-web.tgz', { wd });
if (PACKAGES_TO_INSTALL.length === 0) {
await runShellCmd('npm ci', { wd });
} else {
await runShellCmd(`npm install ${PACKAGES_TO_INSTALL.map((i) => `"${i}"`).join(' ')}`, { wd });
}
}

const launchBrowserAndRunTests = async (logPrefix, port = 3000) => {
Expand Down
4 changes: 1 addition & 3 deletions js/web/test/e2e/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ async function main() {

// perform exports testing
{
fs.copySync(PACKAGES_TO_INSTALL[0], path.join(TEST_E2E_RUN_FOLDER, 'exports', 'onnxruntime-common.tgz'));
fs.copySync(PACKAGES_TO_INSTALL[1], path.join(TEST_E2E_RUN_FOLDER, 'exports', 'onnxruntime-web.tgz'));
const testExportsMain = require(path.join(TEST_E2E_RUN_FOLDER, './exports/main'));
await testExportsMain(PRESERVE);
await testExportsMain(PRESERVE, PACKAGES_TO_INSTALL);
}

// prepare .wasm files for path override testing
Expand Down

0 comments on commit e8247d5

Please sign in to comment.