test(all): run all test types from `run-tests.sh` script
RENAME
packages/@integration/docker-compose.yml
docker-compose.yml
MODIFY
package.json
package.json
"link:all": "lerna exec -- yarn link",
"unlink:all": "lerna exec -- yarn unlink",
"test": "yarn test:unit && yarn test:integration",
- "test:unit": "SCOPE=unit jest --expand --coverage --detectOpenHandles",
- "test:integration": "SCOPE=integration ./scripts/run-integration-tests.sh",
- "test:watch": "jest --expand --onlyChanged --watch",
+ "test:unit": "SCOPE=unit ./scripts/run-tests.sh",
+ "test:watch": "SCOPE=watch ./scripts/run-tests.sh",
+ "test:integration": "SCOPE=integration ./scripts/run-tests.sh",
"clean": "lerna run clean",
"purge": "yarn clean && rimraf node_modules",
"prepublishOnly": "yarn clean && yarn build && yarn test",

DELETE
scripts/run-integration-tests.sh
-#!/bin/bash
-
-RABBITMQ_CONTAINER=marble-rabbit
-
-function wait_for_rabbit () {
- until docker exec $RABBITMQ_CONTAINER rabbitmqctl cluster_status > /dev/null 2>&1
- do
- sleep 2
- echo "Waiting for rabbitmq..."
- done
-}
-
-docker-compose -f packages/@integration/docker-compose.yml up -d
-
-wait_for_rabbit
-
-jest --expand --detectOpenHandles --runInBand
-docker-compose -f packages/@integration/docker-compose.yml down

ADD
scripts/run-tests.sh
+#!/bin/bash
+
+RABBITMQ_CONTAINER=marble-rabbit
+
+function wait_for_rabbit () {
+ until docker exec $RABBITMQ_CONTAINER rabbitmqctl cluster_status > /dev/null 2>&1
+ do
+ sleep 2
+ echo "Waiting for rabbitmq..."
+ done
+}
+
+docker-compose -f docker-compose.yml up -d
+
+wait_for_rabbit
+
+if [ "$SCOPE" == "unit" ]; then
+ jest --expand --coverage --detectOpenHandles
+elif [ "$SCOPE" == "watch" ]; then
+ jest --expand --onlyChanged --watch
+else
+ jest --expand --detectOpenHandles --runInBand
+fi
+
+docker-compose -f docker-compose.yml down

test(all): run all test types from `run-tests.sh` script