From 561f688e2a3f06e1841aa8f2cfdd7ecd2793267f Mon Sep 17 00:00:00 2001 From: Ocasta Date: Tue, 21 Jan 2025 23:44:08 -0800 Subject: [PATCH] prettier --- package-lock.json | 20 ++++++++- src/test/suite/extension.test.js | 70 ++++++++++++++++---------------- src/test/suite/index.js | 70 ++++++++++++++++---------------- 3 files changed, 88 insertions(+), 72 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6940e0d4d7..c16b15f88e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/src/test/suite/extension.test.js b/src/test/suite/extension.test.js index b8ddff26c6..f9d3305db0 100644 --- a/src/test/suite/extension.test.js +++ b/src/test/suite/extension.test.js @@ -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 + }) +}) diff --git a/src/test/suite/index.js b/src/test/suite/index.js index 50c997b131..36dccbf9f0 100644 --- a/src/test/suite/index.js +++ b/src/test/suite/index.js @@ -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 }