From fe14d25d9a4c3971735562fdf189333ecadef52c Mon Sep 17 00:00:00 2001 From: Vishwas Date: Thu, 13 Jun 2024 14:18:43 +0530 Subject: [PATCH 1/3] Update get-test-command prompt --- src/helpers/get-test-command.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/helpers/get-test-command.ts b/src/helpers/get-test-command.ts index c9f95e1..f9afe40 100644 --- a/src/helpers/get-test-command.ts +++ b/src/helpers/get-test-command.ts @@ -28,16 +28,27 @@ export async function getTestCommand({ { role: 'user', content: dedent` - Here is my package.json. I want to run a single command to run the tests (e.g. "npm run test"). The tests should not run in watch mode, they should - exit once completed. Bonus points if the command only runs this specific test \`${testFilePath}\` such as \`npm test -- ${ + Here is my package.json. I want to run a single command to execute the tests. The tests should not run in watch mode. + If there is a test script in the package.json, use that script. For example, \`npm test\`. + The command should filter and run the specific test file at \`${testFilePath}\`. For example, \`npm test -- ${ testFilePath.split('/').pop()!.split('.')[0] }\`. + Here are sample npm test commands without watch mode that work for some popular testing libraries: + - Jest: \`npm test -- ${ + testFilePath.split('/').pop()!.split('.')[0] + } --no-watch \` + - Vitest: \`npm test -- ${ + testFilePath.split('/').pop()!.split('.')[0] + } --run \` + ${packageJson} - If there are no testing libraryes in the package.json, \`npx vitest ...\` is a good option. + If no testing libraries are found in the package.json, use \`npx vitest run ${ + testFilePath.split('/').pop()!.split('.')[0] + }\` as a fallback. `, }, ], From 5809c404401098b137e15317a6d9400b89e41245 Mon Sep 17 00:00:00 2001 From: Vishwas Date: Thu, 13 Jun 2024 14:18:59 +0530 Subject: [PATCH 2/3] Remove unnecessary addNumbers function --- src/helpers/add-numbers.ts | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 src/helpers/add-numbers.ts diff --git a/src/helpers/add-numbers.ts b/src/helpers/add-numbers.ts deleted file mode 100644 index 158b973..0000000 --- a/src/helpers/add-numbers.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function addNumbers(a: any, b: any): number { - // Validate that both inputs are numbers - if (typeof a !== 'number' || typeof b !== 'number') { - throw new Error('Both arguments must be numbers'); - } - - // Return the sum of the two numbers - return a + b; -} From 93fabdf92b3ebd0944490c8d13dfd9849ff033cf Mon Sep 17 00:00:00 2001 From: Vishwas Date: Thu, 13 Jun 2024 14:25:01 +0530 Subject: [PATCH 3/3] Prettier --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abde5c5..5590e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,9 @@ All notable changes to this project will be documented in this file. See [standa ### [0.0.43](https://github.com/BuilderIO/micro-agent/compare/v0.0.42...v0.0.43) (2024-06-12) - ### Features -* detect if in a valid project and generate one if not ([b8a5731](https://github.com/BuilderIO/micro-agent/commit/b8a5731e82fd5541c738cdf094870fbac035386b)) +- detect if in a valid project and generate one if not ([b8a5731](https://github.com/BuilderIO/micro-agent/commit/b8a5731e82fd5541c738cdf094870fbac035386b)) ### [0.0.42](https://github.com/BuilderIO/micro-agent/compare/v0.0.41...v0.0.42) (2024-06-12)