Skip to content

Commit f2f667b

Browse files
committed
fix: Improve createTextEditorDecorationType mock implementation
1 parent ef37f83 commit f2f667b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/__mocks__/vscode.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ const vscode = {
1717
window: {
1818
showInformationMessage: jest.fn(),
1919
showErrorMessage: jest.fn(),
20-
createTextEditorDecorationType: jest.fn().mockReturnValue({
20+
createTextEditorDecorationType: jest.fn().mockImplementation((options) => ({
21+
...options,
2122
dispose: jest.fn(),
22-
}),
23+
key: Math.random().toString(),
24+
})),
2325
tabGroups: {
2426
onDidChangeTabs: jest.fn(() => {
2527
return {

0 commit comments

Comments
 (0)