-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nagarjun Sanji
committed
Jul 4, 2024
1 parent
328bc8d
commit 2efac79
Showing
2 changed files
with
22 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
// test/commands.test.ts | ||
import * as assert from 'assert'; | ||
import * as vscode from 'vscode'; | ||
import * as sinon from 'sinon'; | ||
import { helloWorldCommand } from '../../commands/helloWorldCommand'; | ||
// // test/commands.test.ts | ||
// import * as assert from 'assert'; | ||
// import * as vscode from 'vscode'; | ||
// import * as sinon from 'sinon'; | ||
// import { helloWorldCommand } from '../../commands/helloWorldCommand'; | ||
|
||
suite('Index : Commands Test Suite', () => { | ||
// suite('Index : Commands Test Suite', () => { | ||
|
||
test('Register Commands', () => { | ||
const context: vscode.ExtensionContext = { | ||
subscriptions: [], | ||
} as any; | ||
// test('Register Commands', () => { | ||
// const context: vscode.ExtensionContext = { | ||
// subscriptions: [], | ||
// } as any; | ||
|
||
const helloWorldCommandSpy = sinon.spy(helloWorldCommand); | ||
// const helloWorldCommandSpy = sinon.spy(helloWorldCommand); | ||
|
||
// Replace the helloWorldCommand in the commands array with the spy | ||
const commands = [helloWorldCommandSpy]; | ||
// // Replace the helloWorldCommand in the commands array with the spy | ||
// const commands = [helloWorldCommandSpy]; | ||
|
||
// Mock the module to use the commands array with the spy | ||
const mockregisterCommands = (context: vscode.ExtensionContext) => { | ||
commands.forEach(command => command.call(this, context)); | ||
}; | ||
// // Mock the module to use the commands array with the spy | ||
// const mockregisterCommands = (context: vscode.ExtensionContext) => { | ||
// commands.forEach(command => command.call(this, context)); | ||
// }; | ||
|
||
mockregisterCommands(context); | ||
// mockregisterCommands(context); | ||
|
||
// Verify that the command was called | ||
assert.strictEqual(helloWorldCommandSpy.calledOnce, true); | ||
}); | ||
}); | ||
// // Verify that the command was called | ||
// assert.strictEqual(helloWorldCommandSpy.calledOnce, true); | ||
// }); | ||
// }); |