-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix entry not found when launching apex replay debugger from ape…
…x class (#5326) * fix: correct resolution of the test class file URI @W-12508503@ * chore: post telemtry when file flush renames a file * chore: add tests * chore: fix copyright year * chore: update eslint header template for new year
- Loading branch information
1 parent
0ac3c72
commit 1631048
Showing
5 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/salesforcedx-utils-vscode/test/jest/helpers/utils.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import { realpathSync } from 'fs'; | ||
import { TelemetryService } from '../../../src'; | ||
import { flushFilePath } from '../../../src/helpers/utils'; | ||
|
||
describe('flushFilePath', () => { | ||
let teleSpy: jest.SpyInstance; | ||
beforeEach(() => { | ||
jest.mock('fs'); | ||
jest.mock('../../../src/context/workspaceContextUtil'); | ||
}); | ||
it('should detect changes in character casing', () => { | ||
const originalPath = './test.txt'; | ||
const alteredPath = './TEST.txt'; | ||
|
||
jest.spyOn(realpathSync, 'native').mockReturnValue(alteredPath); | ||
teleSpy = jest.spyOn(TelemetryService.prototype, 'sendEventData'); | ||
|
||
const r = flushFilePath(originalPath); | ||
expect(r).toEqual(alteredPath); | ||
expect(teleSpy).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it('should not send to telemetry if there are no changes in character casing', () => { | ||
const originalPath = './test.txt'; | ||
const alteredPath = './test.txt'; | ||
|
||
jest.spyOn(realpathSync, 'native').mockReturnValue(alteredPath); | ||
teleSpy = jest.spyOn(TelemetryService.prototype, 'sendEventData'); | ||
|
||
const r = flushFilePath(originalPath); | ||
expect(r).toEqual(alteredPath); | ||
expect(teleSpy).not.toHaveBeenCalled(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters