Skip to content

Commit f634a7e

Browse files
committed
Integrate firestore emulator in CI and tests
1 parent 15e4f47 commit f634a7e

File tree

15 files changed

+1015
-115
lines changed

15 files changed

+1015
-115
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
uses: actions/setup-node@v1
2929
with:
3030
node-version: ${{ matrix.node-version }}
31+
- run: npm install -g firebase-tools
3132
- run: npm install
3233
- run: npm run build --if-present
3334
- run: npm test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ lib-cov
2222

2323
# Coverage directory used by tools like istanbul
2424
coverage
25+
.coverage
2526
*.lcov
2627

2728
# nyc test coverage

config/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,11 @@ module.exports = {
4747
'QnrvpfRSihRktA2dDQJAH+dQBx3nG3bZ9khVAZQ1jTJ7j0cKixaGndFuYS1TJvJ2\n' +
4848
'Zzn584h/xbSIcP9/4SXmEK3wtoueUtMkvS3yKTvk+w==\n' +
4949
'-----END RSA PRIVATE KEY-----'
50+
},
51+
52+
db: {
53+
firestore: {
54+
projectId: 'rds-dev'
55+
}
5056
}
5157
}

firebase.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"emulators": {
3+
"firestore": {
4+
"port": 8080
5+
},
6+
"ui": {
7+
"enabled": true,
8+
"port": 4000
9+
}
10+
}
11+
}

nyc.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Nyc coverage config
3+
* Documentation: https://github.com/istanbuljs/nyc#common-configuration-options
4+
*/
5+
module.exports = {
6+
all: true,
7+
exclude: [
8+
'**/test.js'
9+
],
10+
reporter: ['text', 'lcov', 'text-summary'],
11+
reportDir: '.coverage',
12+
tempDir: '.coverage'
13+
}

0 commit comments

Comments
 (0)