/quick-test
/quick-test
generates unit tests.
Use it to quickly create a basic set of tests covering key behaviors of your code.
Using /quick-test
Open a file: Open a file in your project.
Activate iQooz Gen: Click the iQooz Gen logo in the Extensions bar.
Focus: Select the part of the code you want to generate a quick test for. It could be a few lines of code, a method, an entire file, your local changes and more.
Call the Command: Type
/quick-test
in the chatbox.(Optional) Add optional instructions: You can give iQooz Gen any specific guidelines.
Result! iQooz Gen will generate a test tailored for your code.
(Optional) Continue your chat: To give iQooz Gen more instructions, just type a command or ask a question to keep chatting.
Example
Given this code snippet:
Copy
function sayHello(name) {
return "Hello World! I'm " + name;
}
const user = "Username";
const hello = sayHello(user);
console.log(hello);
Command
Copy
/quick-test [optional instructions]
Response
iQooz Gen will analyze your code, identifying key behaviors to create focused and effective test cases. Click on any behavior to understand its testing significance.
Copy
import { expect } from 'chai';
describe('sayHello', () => {
it('test_sayHello_with_valid_name', () => {
const result = sayHello('Alice');
expect(result).to.equal("Hello World! I'm Alice");
});
it('test_sayHello_with_empty_name', () => {
const result = sayHello('');
expect(result).to.equal("Hello World! I'm ");
});
it('test_sayHello_with_non_string_input', () => {
const result = sayHello(123 as any);
expect(result).to.equal("Hello World! I'm 123");
});
});
Last updated