-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[monitor] Move @azure/monitor-opentelemetry-exporter to ESM/vitest #31448
base: main
Are you sure you want to change the base?
Conversation
API change check API changes are not detected in this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely!
@@ -32,20 +29,15 @@ | |||
"test:node": "npm run clean && npm run build:test && npm run unit-test:node", | |||
"unit-test": "npm run unit-test:node && npm run unit-test:browser", | |||
"unit-test:browser": "echo skipped", | |||
"unit-test:node": "dev-tool run test:node-tsx-ts -- --timeout 1200000 \"test/internal/**/*.test.ts\"", | |||
"unit-test:node:debug": "dev-tool run test:node-tsx-ts -- --timeout 1200000 \"test/internal/**/*.test.ts\"", | |||
"unit-test:node": "dev-tool run test:vitest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to add a mod to do this automatically, but do note that the timeouts need to be copied over manually. Mocha had one timeout but vitest has test-timeout and hook-timeout so either one might need to be updated
@@ -66,18 +66,6 @@ describe("FileSystemPersist", () => { | |||
deleteFolderRecursive(tempDir); | |||
}); | |||
|
|||
afterEach((done) => { | |||
fs.readdir(tempDir, (err, files) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this no longer needed?
assert.strictEqual(envelope.name, name); | ||
assert.strictEqual(envelope.sampleRate, sampleRate); | ||
assert.deepStrictEqual(envelope.data?.baseType, baseType); | ||
assert.isDefined(envelope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would assert.exist
give you better typing so you don't need the ?
below? Sometimes it works for me and sometimes it does not - I think it depends on where the typings come from (chai or vitest's chai) but one of them is a typeguard
this is a test, so not too concerned
const envelope = { | ||
name: "Name", | ||
time: new Date(), | ||
}; | ||
|
||
before(() => { | ||
beforeAll(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this migrated automatically or manually? If manually, I can add this to the list of codemods
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
Upgrades to ESM/vitest for
@azure/monitor-opentelemetry-exporter
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?
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