Skip to content

Commit

Permalink
test file for demoing
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Erichsen committed Aug 14, 2024
1 parent 50bca94 commit 7dd6173
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/add/add.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { add, substract } from "./add";

describe("add function", () => {
it("should add two positive numbers correctly", () => {
// 1.
// Start typing below and autocomplete should suggest a valid test,
// noting that the model correctly tests the 'add' function based
// on the title of the test that is provided as context
});

// 2.
// Using cmd + I, ask for a more specific test of the substract function.
//
// Prompt: "Create a new unit test for the subtract function, verifying that it can handle negative numbers correctly."

// 3.
// Go into 'add.ts' and uncomment the 'multiply' function.
// Then, return to this file, highlight the entire file, add to chat, use the `/edit` cmd, and ask to update the tests to include the new function.
//
// Prompt: "/edit Update the tests to include the new 'multiply' function."
});
11 changes: 11 additions & 0 deletions core/add/add.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function add(first: number, second: number): number {
return first + second;
}

export function substract(first: number, second: number): number {
return first - second;
}

// export function multiply(first: number, second: number): number {
// return first * second;
// }

0 comments on commit 7dd6173

Please sign in to comment.