Skip to content

Commit bc2a3b1

Browse files
Merge pull request #134 from Cartmanishere/test-suite
Fix firestore emulator issue
2 parents a7823d6 + 6984910 commit bc2a3b1

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

scripts/tests/testIntegration.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,5 @@
33
# set 'test' environment
44
export NODE_ENV='test'
55

6-
# Set environment variable for firestore emulator host
7-
# @todo: Get port value from '../../firebase.json'
8-
export FIRESTORE_EMULATOR_HOST='localhost:8080'
9-
10-
echo 'Start Firestore Emulator:'
11-
firebase emulators:start &
12-
13-
echo 'Running integration tests:'
14-
nyc mocha test/integration/**
15-
16-
# Erase the database
17-
# @todo: Get port value from '../../firebase.json' and projectId from config
18-
# Route; DELETE http://localhost:<PORT>/emulator/v1/projects/<PROJECT_ID>/databases/(default)/documents
19-
echo 'Erasing Firestore data:'
20-
curl -v -X DELETE 'http://localhost:8080/emulator/v1/projects/rds-dev/databases/(default)/documents'
6+
echo 'Start firestore emulator and run integration tests:'
7+
firebase emulators:exec 'nyc mocha test/integration/**'

scripts/tests/testUnit.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,5 @@
33
# set 'test' environment
44
export NODE_ENV='test'
55

6-
# set environment variable for firestore emulator host
7-
# @todo: Get port value from '../../firebase.json'
8-
export FIRESTORE_EMULATOR_HOST='localhost:8080'
9-
10-
echo 'Start Firestore Emulator:'
11-
firebase emulators:start &
12-
13-
echo 'Running unit tests:'
14-
nyc mocha test/unit/**
15-
16-
# Erase the database
17-
# @todo: Get port value from '../../firebase.json' and projectId from config
18-
# Route; DELETE http://localhost:<PORT>/emulator/v1/projects/<PROJECT_ID>/databases/(default)/documents
19-
echo 'Erasing Firestore data:'
20-
curl -v -X DELETE 'http://localhost:8080/emulator/v1/projects/rds-dev/databases/(default)/documents'
6+
echo 'Start firestore emulator and run unit tests:'
7+
firebase emulators:exec 'nyc mocha test/unit/**'

0 commit comments

Comments
 (0)