Skip to content

creating vite template & trying to get it to work #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

juancastano
Copy link
Contributor

No description provided.

Copy link

@benchify benchify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 Benchify Analysis of PR 14

The provided tests indicate that the REACT_APP_USER_PROMPT function has some issues with its output formatting. Specifically, the test that checks if the output starts with the expected string "Create a React application with the following requirements:" is failing. The error suggests that the actual output has an extra newline character at the beginning.

On the other hand, the test that checks if the function accepts only string inputs for the description parameter is passing, indicating that the function correctly handles string inputs.

To resolve the issue, it's recommended to review the REACT_APP_USER_PROMPT function to ensure it correctly formats its output, removing any unwanted newline characters.

@@ -25,8 +43,8 @@ You must return a valid JSON array of file objects. Each file object must have e

Do not include any markdown formatting, code blocks, or explanatory text. The response must be pure JSON.`;

export const VUE_APP_USER_PROMPT = (description: string) => `
Create a Vue.js application with the following requirements:
export const REACT_APP_USER_PROMPT = (description: string) => `
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Output String Format Validation

The output string must start with 'Create a React application with the following requirements:'.

Outcome Example Input # Inputs % of Total
superjson.parse('{"json":[["MaFa"]]}')... view full input 400 100.0%

view all inputs
The property-based test failed because the generated string did not start with the expected prefix 'Create a React application with the following requirements:'. The input argument was "{"json":[["MaFa"]]}" and the actual output string started with a newline character, causing the assertion to fail.

Stack Trace
Error: expect(received).toStartWith(expected)

Expected to start with: "Create a React application with the following requirements:"
Received: "\nCreate a React application with the following requirements:\nMaFa"

    at toStartWith (unknown)
    at <anonymous> (/app/repo/lib/pver_5f848e4f-dedb-422b-8b7b-8caba561ef32.test.ts:44:52)
    at <anonymous> (/app/configuration/fc.setup.ts:183:11)
    at run (/app/node_modules/fast-check/lib/esm/check/property/Property.generic.js:46:33)
    at runIt (/app/node_modules/fast-check/lib/esm/check/runner/Runner.js:18:30)
    at check (/app/node_modules/fast-check/lib/esm/check/runner/Runner.js:62:11)
    at <anonymous> (/app/configuration/fc.setup.ts:197:14)
    at assertWithLogging (/app/configuration/fc.setup.ts:125:3)
    at <anonymous> (/app/repo/lib/pver_5f848e4f-dedb-422b-8b7b-8caba561ef32.test.ts:37:6)
Unit Tests
// Unit Test for "Output String Format Validation": The output string must start with 'Create a React application with the following requirements:'.
function benchify_s(s) {
    return s.replace(/[^a-zA-Z0-9]/g, 'a');
}

it('benchify_s_exec_test_failing_0', () => {
  const args = superjson.parse('{"json":[["MaFa"]]}');

  benchify_s(...args);
});

@@ -25,8 +43,8 @@ You must return a valid JSON array of file objects. Each file object must have e

Do not include any markdown formatting, code blocks, or explanatory text. The response must be pure JSON.`;

export const VUE_APP_USER_PROMPT = (description: string) => `
Create a Vue.js application with the following requirements:
export const REACT_APP_USER_PROMPT = (description: string) => `
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Description Must Be a String

The function should accept only string inputs for the 'description' parameter.

Outcome Example Input # Inputs % of Total
superjson.parse('{"json":[["]xE"]]}')... view full input 200 100.0%

view all inputs
The test has passed, which means the REACT_APP_USER_PROMPT function successfully accepted the input string ["{\"json\":[[\"]xE\"]]"] and returned a defined result as expected. The function correctly handled the string input and returned a prompt message with the provided description. No issues were found in this test scenario.

Unit Tests
// Unit Test for "Description Must Be a String": The function should accept only string inputs for the 'description' parameter.
function benchify_description(description) {
    const result = REACT_APP_USER_PROMPT(description);
    expect(result).toBeDefined();
}

it('benchify_description_exec_test_passing_0', () => {
  const args = superjson.parse('{"json":[["]xE"]]}');

  benchify_description(...args);
});

@juancastano juancastano marked this pull request as ready for review May 19, 2025 10:16
Copy link
Contributor Author

juancastano commented May 19, 2025

Merge activity

  • May 19, 6:16 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 19, 6:47 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 19, 6:49 AM EDT: @juancastano merged this pull request with Graphite.

@juancastano juancastano changed the base branch from 05-16-some_more_prompt_engineering to graphite-base/14 May 19, 2025 10:44
@juancastano juancastano changed the base branch from graphite-base/14 to main May 19, 2025 10:46
@juancastano juancastano force-pushed the 05-16-creating_vite_template_trying_to_get_it_to_work branch from 9b420ae to a557d21 Compare May 19, 2025 10:47
@juancastano juancastano merged commit 638766e into main May 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant