#!/usr/bin/env bash

set -ex
corepack enable;
corepack install;
yarn install;

yarn run playwright install chromium --with-deps;
yarn run build:storybook

exec npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
    "npx http-server storybook-static --port 6006 --silent" \
    "npx wait-on tcp:6006 && yarn test:storybook"
