Skip to content

Commit 8eee50f

Browse files
cover both cjs and esm for testsuite
1 parent 17881d7 commit 8eee50f

File tree

4 files changed

+109
-22
lines changed

4 files changed

+109
-22
lines changed

src/feature-management/package-lock.json

Lines changed: 91 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/feature-management/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
],
1515
"scripts": {
1616
"build": "npm run clean && rollup --config && npm run build-test",
17-
"build-test": "tsc -p ./tsconfig.test.json",
17+
"build-test": "npm run build-test-esm && npm run build-test-cjs",
18+
"build-test-esm": "tsc -p ./tsconfig.test.esm.json",
19+
"build-test-cjs": "tsc -p ./tsconfig.test.cjs.json && echo {\"type\":\"commonjs\"} > out/cjs/package.json",
1820
"clean": "rimraf dist out types",
1921
"dev": "rollup --config --watch",
2022
"lint": "eslint src/ test/ --ignore-pattern test/browser/testcases.js",
2123
"fix-lint": "eslint src/ test/ --fix --ignore-pattern test/browser/testcases.js",
22-
"test": "mocha out/test/*.test.{js,cjs,mjs} --parallel",
24+
"test": "mocha out/esm/test/*.test.js out/cjs/test/*.test.js --parallel",
2325
"test-browser": "npx playwright install chromium && npx playwright test"
2426
},
2527
"repository": {
@@ -43,8 +45,8 @@
4345
"@typescript-eslint/eslint-plugin": "^8.41.0",
4446
"@typescript-eslint/parser": "^8.41.0",
4547
"@playwright/test": "^1.55.0",
46-
"chai": "^6.0.1",
47-
"chai-as-promised": "^8.0.2",
48+
"chai": "^4.5.0",
49+
"chai-as-promised": "^7.1.2",
4850
"eslint": "^9.34.0",
4951
"mocha": "^11.7.1",
5052
"rimraf": "^6.0.1",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"outDir": "./out/cjs"
6+
},
7+
"include": [
8+
"test/*"
9+
]
10+
}

src/feature-management/tsconfig.test.json renamed to src/feature-management/tsconfig.test.esm.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "ESNext",
5-
"outDir": "./out"
5+
"outDir": "./out/esm"
66
},
77
"include": [
88
"test/*"
99
]
10-
}
10+
}

0 commit comments

Comments
 (0)