Skip to content

Conversation

@drikusroor
Copy link
Owner

@drikusroor drikusroor commented Jan 19, 2025

Set up automatic build and test for pull requests to the main branch using GitHub flow, Vitest for tests, and Bun for installing packages and running build and test.

  • package.json

    • Add a test script to run Vitest.
    • Add vitest to devDependencies with version ^3.0.0.
  • .github/workflows/ci.yml

    • Update the workflow to trigger on pull requests to the main branch.
    • Add steps to set up Bun, install dependencies, run build, and execute tests using Vitest.
    • Ensure the workflow deploys on push to the main branch.
  • vitest.config.ts

    • Create a Vitest configuration file with basic settings.

For more details, open the Copilot Workspace session.

…flow

Set up automatic build and test for pull requests to the main branch using GitHub flow, Vitest for tests, and Bun for installing packages and running build and test.

* **package.json**
  - Add a `test` script to run Vitest.
  - Add `vitest` to `devDependencies` with version `^3.0.0`.

* **.github/workflows/ci.yml**
  - Update the workflow to trigger on pull requests to the `main` branch.
  - Add steps to set up Bun, install dependencies, run build, and execute tests using Vitest.
  - Ensure the workflow deploys on push to the `main` branch.

* **vitest.config.ts**
  - Create a Vitest configuration file with basic settings.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/drikusroor/elastistent?shareId=XXXX-XXXX-XXXX-XXXX).
* Add `vitest` with version `^3.0.0`
* Add `jsdom` with version `^26.0.0`
* Import necessary modules and render the `App` component
* Write a simple test to check if the `App` component renders without crashing
* Add `vitest` to `devDependencies` with version `^3.0.0`
* Add `jsdom` to `devDependencies` with version `^26.0.0`
* Add `@testing-library/react` to `devDependencies` with version `^14.0.0`
* **package.json**
  - Add `@testing-library/jest-dom`, `@testing-library/react`, `@types/jsdom`, `jsdom`, and `vitest` to `devDependencies`.

* **src/App.test.tsx**
  - Import `test` and `expect` from `vitest`.
  - Import `@testing-library/jest-dom/vitest`.
  - Update test to use `document.body` for checking element presence.

* **vite.config.ts**
  - Add `test` configuration with `jsdom` environment.

* **package-lock.json**
  - Add new file with dependencies.
…sistency

* **App.test.tsx**
  - Change test to use `getByTestId` instead of `getByText`
  - Add `data-testid` attribute to the title element in `App.tsx`

* **App.tsx**
  - Replace single quotes with double quotes for consistency
  - Add `data-testid` attribute to the title element
  - Refactor various functions to use arrow functions and consistent formatting
  - Update event listeners to use double quotes for event names
@drikusroor drikusroor merged commit d626162 into main Jan 19, 2025
2 checks 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.

2 participants