Skip to content

Commit

Permalink
use-esm-workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
maorleger committed Feb 15, 2024
1 parent 564b60d commit 2b6207b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions common/tools/dev-tool/src/commands/run/testNodeJSInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ export const commandInfo = makeCommandInfo(
default: false,
description: "whether to run with test-proxy",
},
loader: {
shortName: "l",
kind: "string",
default: "esm",
description: "loader to use for running tests",
"use-esm-workaround": {
shortName: "esm",
kind: "boolean",
default: true,
description:
"when true, uses the `esm` npm package for tests. Otherwise uses esm4mocha if needed",
},
},
);

export default leafCommand(commandInfo, async (options) => {
const isModule = await isModuleProject();
let esmLoaderArgs = "";
if ((await isModuleProject()) === false) {
if (options["loader"] === "esm4mocha") {

if (isModule === false) {
if (options["use-esm-workaround"] === false) {
esmLoaderArgs = "--loader=../../../common/tools/esm4mocha.mjs";
} else {
esmLoaderArgs = "-r ../../../common/tools/esm-workaround -r esm";
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-js-input --loader=esm4mocha -- --timeout 180000 'dist-esm/test/public/node/*.spec.js' 'dist-esm/test/internal/node/*.spec.js'",
"integration-test:node": "dev-tool run test:node-js-input --use-esm-workaround=false -- --timeout 180000 'dist-esm/test/public/node/*.spec.js' 'dist-esm/test/internal/node/*.spec.js'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
Expand Down

0 comments on commit 2b6207b

Please sign in to comment.