Skip to content

test(client-PropertyDDS): mocha standardization#26804

Open
jason-ha wants to merge 2 commits intomicrosoft:mainfrom
jason-ha:propertyDDS/test-config-standardization
Open

test(client-PropertyDDS): mocha standardization#26804
jason-ha wants to merge 2 commits intomicrosoft:mainfrom
jason-ha:propertyDDS/test-config-standardization

Conversation

@jason-ha
Copy link
Contributor

Use common mocha configuration pattern.

  • delete unused property-properties/src/test/mocha.opts
  • replace .mocharc.json (incorrect settings) with .mocharc.cjs
  • property-properties test setup .js module relocated away from src/test to test as build is not needed
  • package.json script entries updated to reflect CJS/ESM specifics

Test cases now execute with common [CJS] prefix. Warnings about unmatched file patterns are gone:

Warning: Cannot find any files matching pattern "test/setup.js"
Warning: Cannot find any files matching pattern "test/**/*.spec.js"

Note that property-properties test source files use require (CommonJS) and require conversion to test ESM (which is also not properly converted to support ESM). (The production ESM build is a phony and it not used.)

Additionally suppress blame history for PropertyDDS whitespace formatting commit.

This further applies the changes started by #25503 and #25292 for client workspace.

Use common mocha configuration pattern.
- delete unused `property-properties/src/test/mocha.opts`
- replace `.mocharc.json` (incorrect settings) with `.mocharc.cjs`
- property-properties test setup .js module relocated away from `src/test` to `test` as build is not needed
- package.json script entries updated to reflect CJS/ESM specifics

Test cases now execute with common `[CJS]` prefix.
Warnings about unmatched file patterns are gone:
   ```text
   Warning: Cannot find any files matching pattern "test/setup.js"
   Warning: Cannot find any files matching pattern "test/**/*.spec.js"
   ```

Note that property-properties test source files use `require` (CommonJS) and require conversion to test ESM (which is also not properly converted to support ESM). (The production ESM build is a phony and it not used.)

Additionally suppress blame history for PropertyDDS whitespace formatting commit.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes Mocha configuration in the PropertyDDS client packages to align with the repo-wide @fluid-internal/mocha-test-setup conventions, removing legacy mocha config files and updating test/build scripts accordingly.

Changes:

  • Replaced per-package .mocharc.json / mocha.opts usage with .mocharc.cjs backed by @fluid-internal/mocha-test-setup/mocharc-common.
  • Updated package.json scripts to split mocha execution by module system (CJS/ESM) and align with common FLUID_TEST_MODULE_SYSTEM behavior.
  • Added a .git-blame-ignore-revs entry to suppress formatting-only blame noise for PropertyDDS.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
experimental/PropertyDDS/packages/property-properties/test/setup.cjs Minor setup adjustment/comment around chai should() initialization.
experimental/PropertyDDS/packages/property-properties/src/test/mocha.opts Deleted unused legacy mocha opts file.
experimental/PropertyDDS/packages/property-properties/package.json Updated build/test scripts for common mocha config + CJS/ESM split.
experimental/PropertyDDS/packages/property-properties/.mocharc.json Removed incorrect JSON mocha config.
experimental/PropertyDDS/packages/property-properties/.mocharc.cjs Added shared mocha config wiring + requires test setup.
experimental/PropertyDDS/packages/property-common/package.json Updated build/test scripts for common mocha config + CJS/ESM split.
experimental/PropertyDDS/packages/property-common/.mocharc.json Removed incorrect JSON mocha config.
experimental/PropertyDDS/packages/property-common/.mocharc.cjs Added shared mocha config wiring.
.git-blame-ignore-revs Added ignore entry for a PropertyDDS formatting commit.
Comments suppressed due to low confidence (1)

experimental/PropertyDDS/packages/property-properties/test/setup.cjs:20

  • The inline comment says the chai.should() assignment shouldn't be needed, but the code still assigns to a global should. Since the tests appear to rely on the side-effect of enabling .should rather than the should variable itself, consider changing this to just call chai.should() (no assignment) or removing the comment if the assignment is intentionally kept.

(that were added for future standardization)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants