Skip to content

Commit ab93a59

Browse files
committed
test(client): seek misnamed test files
1 parent 1bcd572 commit ab93a59

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/common/core-interfaces/.mocharc.cjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ const testCJS = process.env.FLUID_TEST_MODULE_SYSTEM === "CJS";
1111
const outputFilePrefix = testCJS ? "CJS-" : "";
1212
const suiteName = "@fluidframework/core-interfaces" + (testCJS ? " - CJS" : "");
1313
module.exports = {
14-
spec: testCJS ? "dist/test/**/*.spec.*js" : "lib/test/**/*.spec.*js",
14+
spec: testCJS ? "dist/test" : "lib/test",
15+
// Ignore "spec" to find misnamed test files.
16+
ignore: ["**/*.spec.{js,cjs,mjs}"],
1517
recursive: true,
1618
require: [testCJS ? "./dist/test/mochaHooks.js" : "./lib/test/mochaHooks.js"],
17-
reporter: "mocha-multi-reporters",
19+
// reporter: "mocha-multi-reporters",
1820
"reporter-options": [
1921
`configFile=test-config.json,cmrOutput=xunit+output+${outputFilePrefix}:xunit+suiteName+${suiteName}`,
2022
],

packages/test/mocha-test-setup/mocharc-common.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,20 @@ function getFluidTestMochaConfig(packageDir, additionalRequiredModules, testRepo
6868
testReportPrefix = testReportPrefix !== undefined ? `${testReportPrefix}-CJS` : "CJS";
6969
}
7070

71+
process.env.FLUID_TEST_VARIANT =
72+
process.env.FLUID_TEST_VARIANT !== undefined
73+
? `bad test filename,${process.env.FLUID_TEST_VARIANT}`
74+
: "bad test filename";
75+
7176
const config = {
7277
"recursive": true,
7378
"require": requiredModulePaths,
7479
"unhandled-rejections": "strict",
7580
ignore: [
7681
// Ignore "tools" which are scripts intended to be run, not part of the test suite.
7782
"**/*.tool.{js,cjs,mjs}",
83+
// Ignore "spec" to find misnamed test files.
84+
"**/*.spec.{js,cjs,mjs}",
7885
],
7986
"node-option": [
8087
// Allow test-only indexes to be imported. Search the FF repo for package.json files with this condition to see example usage.

0 commit comments

Comments
 (0)