Skip to content

[playwright] Dedupe getPackageVersion #35557

@maorleger

Description

@maorleger

Dedupe getPackageVersion implementation.

The code in https://github.com/azure/azure-sdk-for-js/blob/main/sdk/loadtesting/playwright/src/utils/getPackageVersion.ts and https://github.com/azure/azure-sdk-for-js/blob/main/sdk/loadtesting/playwright/src/utils/getPackageVersion-cjs.cts have almost identical implementations, except that the -cjs.cts uses CommonJS and the .ts uses ESM.

In order to reduce duplication:

  1. Move getPackageVersion back into https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/playwright/src/utils/utils.ts
  2. Fix the imports in https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/loadtesting/playwright/src/utils/utils.ts after (1) by importing getPackageVersionFromFolder from "./getPackageVersion.js" - notice that .js is used either way

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions