From 7dd6173e3e9606d5822dbdde7a5920645e1e2a95 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 14 Aug 2024 13:46:48 -0700 Subject: [PATCH] test file for demoing --- core/add/add.test.ts | 21 +++++++++++++++++++++ core/add/add.ts | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 core/add/add.test.ts create mode 100644 core/add/add.ts diff --git a/core/add/add.test.ts b/core/add/add.test.ts new file mode 100644 index 0000000000..1b2f2d897a --- /dev/null +++ b/core/add/add.test.ts @@ -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." +}); diff --git a/core/add/add.ts b/core/add/add.ts new file mode 100644 index 0000000000..a77dc84fcb --- /dev/null +++ b/core/add/add.ts @@ -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; +// }