🚧 testing

This commit is contained in:
Nate Sesti 2024-04-13 22:43:20 -07:00
parent 7c30dff354
commit fa94bddb63
5 changed files with 25 additions and 10 deletions

View file

@ -72,7 +72,9 @@ export class CodebaseIndexer {
// Wait until Git Extension has loaded to report progress
// so we don't appear stuck at 0% while waiting
await this.ide.getRepoName(workspaceDirs[0]);
if (workspaceDirs.length > 0) {
await this.ide.getRepoName(workspaceDirs[0]);
}
yield {
progress: 0,
desc: "Starting indexing...",

View file

@ -455,8 +455,9 @@
"tsc-watch": "tsc -watch -p ./",
"rebuild": "electron-rebuild -v 19.1.8 node-pty",
"lint": "eslint src --ext ts",
"build-test": "npm run esbuild && npm run prepackage && node esbuild.test.mjs",
"test": "npm run build-test && node ./out/runTestOnVSCodeHost.js",
"build-test": "npm run esbuild && node esbuild.test.mjs",
"test": "npm run prepackage && npm run build-test && node ./out/runTestOnVSCodeHost.js",
"quick-test": "npm run build-test && node ./out/runTestOnVSCodeHost.js",
"prepackage": "node scripts/prepackage.js",
"package": "node scripts/package.js",
"package:pre-release": "node scripts/package.js --pre-release",

View file

@ -152,12 +152,19 @@ const exe = os === "win32" ? ".exe" : "";
// Then copy over the dist folder to the VSCode extension //
const vscodeGuiPath = path.join("../extensions/vscode/gui");
fs.mkdirSync(vscodeGuiPath, { recursive: true });
ncp("dist", vscodeGuiPath, (error) => {
if (error) {
console.log("Error copying React app build to VSCode extension: ", error);
throw error;
}
console.log("Copied gui build to VSCode extension");
await new Promise((resolve, reject) => {
ncp("dist", vscodeGuiPath, (error) => {
if (error) {
console.log(
"Error copying React app build to VSCode extension: ",
error,
);
reject(error);
} else {
console.log("Copied gui build to VSCode extension");
resolve();
}
});
});
if (!fs.existsSync(path.join("dist", "assets", "index.js"))) {

View file

@ -7,7 +7,7 @@ export function run() {
const timeoutOption = process.env.MOCHA_TIMEOUT
? parseInt(process.env.MOCHA_TIMEOUT)
: // : undefined;
15_000;
30_000;
// Create the mocha test
const mocha = new Mocha({

View file

@ -11,11 +11,16 @@ describe("Extension Test Suite", () => {
// });
test("Get the default model from webview", async () => {
// Current problem is that this is never resolved, because
// this file is separate from the extension.
const extension = await vscodeExtensionPromise;
await vscode.commands.executeCommand("continue.continueGUIView.focus");
await new Promise((resolve) => setTimeout(resolve, 3_000));
const title = await extension.webviewProtocol.request(
"getDefaultModelTitle",
undefined,
);
console.log("Title of default model is: ", title);
assert.strictEqual(typeof title, "string");
});
});