Skip to content
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

Update the examples #201

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ _This app uses [bun](https://bun.sh/) for dependency management and script execu
1. Install dependencies

```
$ bun install
bun install
```

2. Setup the [database](#database)

3. Start the application

```
$ bun dev
bun dev
```

## Database
Expand All @@ -46,21 +46,21 @@ DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/bookstore"
To run migrations (note: this will automatically run the [seed script](#seeds) after migrations):

```
$ npx prisma migrate dev
npx prisma migrate dev
```

or if you have an `.env.local` file:

```
$ npx dotenv -e .env.local -- prisma migrate dev
npx dotenv -e .env.local -- prisma migrate dev
```

### Create New Migration

To create a new migration (and run it):

```
$ npx prisma migrate dev --name <update name>
npx prisma migrate dev --name <update name>
```

### Seeds
Expand All @@ -72,13 +72,13 @@ The following commands require an `.env.local` file with the `DATABASE_URL`.
To run the seed script to generate fake data:

```
$ bun db:seed
bun db:seed
```

Reset the database, re-run migrations, and re-seed with fake data:

```
$ bun db:reset
bun db:reset
```

#### Overrides
Expand Down Expand Up @@ -116,20 +116,32 @@ https://developer.squareup.com/docs/devtools/sandbox/testing#terminal-api-checko

## Tests

Lint and unit tests are run during CI.

### Lint

This project is configured to use ESLint as the linter.

To run both lint and compile TypeScript files:

```
bun run lint
```

### Unit Tests

Lint and Jest tests are run during CI. These unit tests are stored along side the source code.
The unit tests are stored along side the source code.

To run the tests:

```
$ bun run test
bun run test
```

To run tests in watch mode:

```
$ bun run test:watch
bun run test:watch
```

### Playwright e2e Tests
Expand All @@ -141,19 +153,19 @@ Note that these e2e tests are not run via the GitHub CI actions, since they requ
To run the tests:

```
$ bun playwright test
bun playwright test
```

To run the tests with the Playwright UI:

```
$ bun playwright test --ui
bun playwright test --ui
```

To run the full e2e tests, which _!!resets the database!!_, applies seeds for CI, then runs the playwright e2e tests:

```
$ bun run test:e2e
bun run test:e2e
```

## Storybook
Expand All @@ -163,5 +175,5 @@ This app uses [Storybook](https://storybook.js.org/) to demo UI components.
To run storybook:

```
$ bun storybook
bun storybook
```