Skip to content

[identity] Fix nightly tests#28843

Merged
maorleger merged 1 commit intoAzure:mainfrom
maorleger:identity-mock-fixes
Mar 8, 2024
Merged

[identity] Fix nightly tests#28843
maorleger merged 1 commit intoAzure:mainfrom
maorleger:identity-mock-fixes

Conversation

@maorleger
Copy link
Member

Packages impacted by this PR

@azure/identity

Issues associated with this PR

Nightly test failures

Describe the problem that is addressed by this PR

Our nightly tests started failing with a TypeError: Descriptor for property generatePluginConfiguration is non-configurable and non-writable error.

I'm far from an expert here, but I believe the error is due to ESModules being
immutable, whereas CJS Modules are mutable.

Wrapping the stubbable / mockable object is a reasonable workaround to keep
tests green regardless of whether they get run as ESM or CJS

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Deleting the tests is an option, or an integration test. Neither seem to fit the
bill here. Once we have credentials migrated over we may be able to delete some
of the unit tests and rely on recorded tests to test the various scenarios. But
we are not there yet.

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR: (Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description.
  • Does this PR need any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here.)
  • Added a changelog (if necessary).

@maorleger maorleger marked this pull request as ready for review March 8, 2024 19:12
@maorleger maorleger requested review from a team, KarishmaGhiya and schaabs as code owners March 8, 2024 19:12
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@maorleger maorleger enabled auto-merge (squash) March 8, 2024 19:31
@maorleger maorleger merged commit 6e1b9b3 into Azure:main Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants