You can run PostgreSQL database locally using Docker PostgreSQL Image:
docker-compose up -d
During database initialization two databases will be created lineddev
for development purpose and linentest
for integration tests (see postgres/initdb/00-init-app-db.sh
).
Together with PostgreSQL, pgAdmin 4 container is setup - a web based administration tool for the PostgreSQL database.
You can access it at http://localhost:8080 (credentials: admin@admin.com/secret).
Click the Add New Server button to open the Server Dialog
to add a new server definition (use db
as host name/address and postgres
for database, username and password).
To fill the database with initial data run:
docker exec -i -u postgres linendev_postgres psql linendev < db_seed.sql
Run the migration to update the database:
npx prisma migrate dev
npx prisma migrate dev
Load: http://localhost:3000/api/oneOff This will fetch all the conversations from Papercups and it will return all the conversations and save the account_id from one of the channels
Update accountId
const in constants/example.js
npx prisma migrate dev
npx prisma generate
or
npm run migrate
See Prisma CLI reference for command description.
Setup .env.test
:
- add
SLACK_TOKEN
to.env.test
- the integration tests uses a real Slack account - add
DATABASE_URL=postgresql://linentest:linentest@localhost:5432/linentest
to.env.test
npm run setup:integration
Run tests:
npm run test:integration
Run specific test example:
npm run test:integration webhook.test.ts