This commit is contained in:
Ocasta 2025-01-21 23:44:08 -08:00
parent a5bfd74c6d
commit 561f688e2a
3 changed files with 88 additions and 72 deletions

20
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "claude-dev",
"version": "3.2.4",
"version": "3.2.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "claude-dev",
"version": "3.2.4",
"version": "3.2.5",
"license": "Apache-2.0",
"dependencies": {
"@anthropic-ai/bedrock-sdk": "^0.10.2",
@ -62,6 +62,7 @@
"chai": "^4.3.10",
"esbuild": "^0.21.5",
"eslint": "^8.57.0",
"husky": "^9.1.7",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.3",
"should": "^13.2.3",
@ -7770,6 +7771,21 @@
"ms": "^2.0.0"
}
},
"node_modules/husky": {
"version": "9.1.7",
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
"dev": true,
"bin": {
"husky": "bin.js"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
"node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",

View file

@ -1,37 +1,37 @@
const { expect } = require('chai');
const vscode = require('vscode');
const { expect } = require("chai")
const vscode = require("vscode")
describe('Extension Tests', function() {
this.timeout(60000); // Increased timeout for extension operations
describe("Extension Tests", function () {
this.timeout(60000) // Increased timeout for extension operations
it('should activate extension successfully', async () => {
// Get the extension
const extension = vscode.extensions.getExtension('saoudrizwan.claude-dev');
expect(extension).to.not.be.undefined;
// Activate the extension if not already activated
if (!extension.isActive) {
await extension.activate();
}
expect(extension.isActive).to.be.true;
});
it('should open sidebar view', async () => {
// Execute the command to open sidebar
await vscode.commands.executeCommand('cline.plusButtonClicked');
// Wait for sidebar to be visible
await new Promise(resolve => setTimeout(resolve, 1000));
// Get all views
const views = vscode.window.visibleTextEditors;
// Just verify the command executed without error
// The actual view verification is handled in the TypeScript tests
});
it('should handle basic commands', async () => {
// Test basic command execution
await vscode.commands.executeCommand('cline.historyButtonClicked');
// Success if no error thrown
});
});
it("should activate extension successfully", async () => {
// Get the extension
const extension = vscode.extensions.getExtension("saoudrizwan.claude-dev")
expect(extension).to.not.be.undefined
// Activate the extension if not already activated
if (!extension.isActive) {
await extension.activate()
}
expect(extension.isActive).to.be.true
})
it("should open sidebar view", async () => {
// Execute the command to open sidebar
await vscode.commands.executeCommand("cline.plusButtonClicked")
// Wait for sidebar to be visible
await new Promise((resolve) => setTimeout(resolve, 1000))
// Get all views
const views = vscode.window.visibleTextEditors
// Just verify the command executed without error
// The actual view verification is handled in the TypeScript tests
})
it("should handle basic commands", async () => {
// Test basic command execution
await vscode.commands.executeCommand("cline.historyButtonClicked")
// Success if no error thrown
})
})

View file

@ -1,43 +1,43 @@
const path = require('path');
const Mocha = require('mocha');
const glob = require('glob');
const path = require("path")
const Mocha = require("mocha")
const glob = require("glob")
async function run() {
// Create the mocha test
const mocha = new Mocha({
ui: 'bdd',
color: true,
timeout: 60000 // Increased timeout for extension operations
});
// Create the mocha test
const mocha = new Mocha({
ui: "bdd",
color: true,
timeout: 60000, // Increased timeout for extension operations
})
const testsRoot = path.resolve(__dirname, '.');
const testsRoot = path.resolve(__dirname, ".")
try {
// Find all test files
const files = await glob('*.test.js', { cwd: testsRoot });
try {
// Find all test files
const files = await glob("*.test.js", { cwd: testsRoot })
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)))
// Run the mocha test
return new Promise((resolve, reject) => {
try {
// Run the tests
mocha.run(failures => {
if (failures > 0) {
reject(new Error(`${failures} tests failed.`));
} else {
resolve();
}
});
} catch (err) {
reject(err);
}
});
} catch (err) {
console.error('Failed to run tests:', err);
throw err;
}
// Run the mocha test
return new Promise((resolve, reject) => {
try {
// Run the tests
mocha.run((failures) => {
if (failures > 0) {
reject(new Error(`${failures} tests failed.`))
} else {
resolve()
}
})
} catch (err) {
reject(err)
}
})
} catch (err) {
console.error("Failed to run tests:", err)
throw err
}
}
module.exports = { run };
module.exports = { run }