mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
* feat: pnpm * Update publish script * gitignore the pnpm debug log * Fix workspace * Fix dev commands * feat: pnpm * Update publish script * gitignore the pnpm debug log * Fix workspace * Fix dev commands * chore: fix pnpm install in GitHub Action * fix: update tsconfig path * pnpm run -> pnpm * chore: remove cache-node and add back setup-node * fix: tsconfig dependencies * chore: fix tsconfig path * fix: adapter-test dependencies * fix: setup-node for release-pr * fix: import adapter-test * chore: update workspace dependency for next-auth * fix: test failure * fix: add jest for adapters * fix: jest again * fix: mongo in prisma * fix: `--no-git-checks` for `release-pr` Co-authored-by: Balázs Orbán <info@balazsorban.com>
33 lines
801 B
Bash
Executable File
33 lines
801 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CONTAINER_NAME=next-auth-mongodb-test
|
|
|
|
JEST_WATCH=false
|
|
|
|
# Is the watch flag passed to the script?
|
|
while getopts w flag
|
|
do
|
|
case "${flag}" in
|
|
w) JEST_WATCH=true;;
|
|
*) continue;;
|
|
esac
|
|
done
|
|
|
|
# Start db
|
|
docker run -d --rm -p 27017:27017 --name ${CONTAINER_NAME} "prismagraphql/mongo-single-replica:4.4.3-bionic"
|
|
|
|
pnpm prisma generate --schema ./prisma/mongodb.prisma
|
|
|
|
if $JEST_WATCH; then
|
|
# Run jest in watch mode
|
|
npx jest --watch
|
|
# Only stop the container after jest has been quit
|
|
docker stop "${CONTAINER_NAME}"
|
|
else
|
|
# Always stop container, but exit with 1 when tests are failing
|
|
if CONTAINER_NAME=${CONTAINER_NAME} npx jest;then
|
|
docker stop ${CONTAINER_NAME}
|
|
else
|
|
docker stop ${CONTAINER_NAME} && exit 1
|
|
fi
|
|
fi |