diff --git a/README.md b/README.md index a3182b5..df4cc71 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,76 @@ -# listly +# Listly [![Deploy to GitHub Pages](https://github.com/nishanbajracharya/listly/actions/workflows/deploy.yml/badge.svg)](https://github.com/nishanbajracharya/listly/actions/workflows/deploy.yml) -Ranked list maker +Listly is a ranked list maker application that allows users to create, compare, and rank lists with ease. This project is deployed on GitHub Pages and is built using modern web technologies. + +## Getting Started + +To get started with Listly, follow these steps: + +### Prerequisites + +- Node.js (version `22` or higher) + +### Installation + +1. Clone the repository: + ```sh + git clone https://github.com/nishanbajracharya/listly.git + ``` +2. Navigate to the project directory: + ```sh + cd listly + ``` +3. Install the dependencies: + ```sh + npm install + ``` + +### Running the Application + +To run the application locally, use the following command: + +```sh +npm run dev +``` + +This will start the development server and you can access the application at http://localhost:3000. + +### Running Tests + +To run the tests for the application, use the following command: + +```sh +npm test +``` + +This will execute the test suite and display the results along with test coverage. + +### Building for Production + +To build the application for production, use the following command: + +```sh +npm run build +``` + +The production-ready files will be generated in the dist directory. + +### Deploying to GitHub Pages + +To deploy the application to GitHub Pages, use the following command: + +```sh +npm run deploy +``` + +This will build the application and push the dist directory to the gh-pages branch. + +### Contributing + +If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. + +### License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. diff --git a/test-utils/index.ts b/tests/__utils/index.ts similarity index 100% rename from test-utils/index.ts rename to tests/__utils/index.ts diff --git a/test-utils/render.tsx b/tests/__utils/render.tsx similarity index 93% rename from test-utils/render.tsx rename to tests/__utils/render.tsx index b8a992d..6911233 100644 --- a/test-utils/render.tsx +++ b/tests/__utils/render.tsx @@ -4,7 +4,7 @@ import { Notifications } from '@mantine/notifications'; import { render as testingLibraryRender } from '@testing-library/react'; // Import your theme object -import theme from '../src/theme'; +import theme from '../../src/theme'; export function render(ui: React.ReactNode) { return testingLibraryRender(<>{ui}, { diff --git a/tests/components/App.test.tsx b/tests/components/App.test.tsx index a3f4edf..8f3e336 100644 --- a/tests/components/App.test.tsx +++ b/tests/components/App.test.tsx @@ -3,8 +3,8 @@ import { describe, it, expect } from 'vitest'; import App from '../../src/App'; import { l } from '../../src/modules/language'; +import { render, screen, fireEvent } from '../__utils'; import en from '../../src/constants/localization/en.json'; -import { render, screen, fireEvent } from '../../test-utils'; describe('App component', () => { const navigation = [ diff --git a/tests/components/Compare.test.tsx b/tests/components/Compare.test.tsx index fc65ed3..b0fc301 100644 --- a/tests/components/Compare.test.tsx +++ b/tests/components/Compare.test.tsx @@ -3,9 +3,9 @@ import { Router } from 'wouter'; import { describe, it, expect } from 'vitest'; import { l } from '../../src/modules/language'; +import { render, screen, fireEvent } from '../__utils'; import Compare from '../../src/components/pages/Compare'; import en from '../../src/constants/localization/en.json'; -import { render, screen, fireEvent } from '../../test-utils'; describe('Compare component', () => { const list = ['A', 'B', 'C']; diff --git a/tests/components/Home.test.tsx b/tests/components/Home.test.tsx index 6ba82d8..4c63119 100644 --- a/tests/components/Home.test.tsx +++ b/tests/components/Home.test.tsx @@ -4,7 +4,7 @@ import { describe, it, expect } from 'vitest'; import { l } from '../../src/modules/language'; import Home from '../../src/components/pages/Home'; import en from '../../src/constants/localization/en.json'; -import { render, screen, waitFor, fireEvent } from '../../test-utils'; +import { render, screen, waitFor, fireEvent } from '../__utils'; describe('Home component', () => { const listInput = 'A,B,C,D'; diff --git a/tests/components/Rank.test.tsx b/tests/components/Rank.test.tsx index 5bb19d4..1e23e6c 100644 --- a/tests/components/Rank.test.tsx +++ b/tests/components/Rank.test.tsx @@ -6,8 +6,8 @@ import Shell from '../../src/components/Shell'; import { l } from '../../src/modules/language'; import Rank from '../../src/components/pages/Rank'; import { encode } from '../../src/modules/encoding'; +import { render, screen, fireEvent } from '../__utils'; import en from '../../src/constants/localization/en.json'; -import { render, screen, fireEvent } from '../../test-utils'; describe('Rank component', () => { const list = ['A', 'B', 'C']; diff --git a/vitest.config.ts b/vitest.config.ts index 5237ffc..ba97d41 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ coverage: { provider: 'istanbul', exclude: [ - '**/test-utils/**', + '**/tests/__utils/**', '**/tests/**', '**.config.cjs', 'src/main.tsx',