Skip to content

Commit bd4396c

Browse files
authored
chore: fix formatting, github workflow deprecation, and missing changelog (#259)
* chore: fix formatting, github workflow deprecation, and missing changelog. * Cut nodejs18. * Use more description changelog.
1 parent 56287f4 commit bd4396c

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

.github/workflows/test.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
strategy:
1414
matrix:
1515
node-version:
16-
- 14.x
17-
- 16.x
16+
- 20.x
17+
- 22.x
1818
steps:
19-
- uses: actions/checkout@v1
20-
- uses: actions/setup-node@v1
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323

2424
- name: Cache npm
25-
uses: actions/cache@v1
25+
uses: actions/cache@v4
2626
with:
2727
path: ~/.npm
2828
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
@@ -36,16 +36,16 @@ jobs:
3636
strategy:
3737
matrix:
3838
node-version:
39-
- 14.x
40-
- 16.x
39+
- 20.x
40+
- 22.x
4141
steps:
42-
- uses: actions/checkout@v1
43-
- uses: actions/setup-node@v1
42+
- uses: actions/checkout@v3
43+
- uses: actions/setup-node@v3
4444
with:
4545
node-version: ${{ matrix.node-version }}
4646

4747
- name: Cache npm
48-
uses: actions/cache@v1
48+
uses: actions/cache@v4
4949
with:
5050
path: ~/.npm
5151
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Support FIRESTORE_EMULATOR_HOST env var for Firestore triggers (#184)

spec/providers/firestore.spec.ts

+23-17
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('providers/firestore', () => {
1414
test = fft();
1515
fakeHttpResponse = {
1616
statusCode: 200,
17-
on: ((event, cb) => cb())
17+
on: (event, cb) => cb(),
1818
};
1919
fakeHttpRequestMethod = sinon.fake((config, cb) => {
2020
cb(fakeHttpResponse);
@@ -91,26 +91,32 @@ describe('providers/firestore', () => {
9191
it('should use host name from FIRESTORE_EMULATOR_HOST env in clearFirestoreData', async () => {
9292
process.env.FIRESTORE_EMULATOR_HOST = 'not-local-host:8080';
9393

94-
await test.firestore.clearFirestoreData({projectId: 'not-a-project'});
95-
96-
expect(fakeHttpRequestMethod.calledOnceWith({
97-
hostname: 'not-local-host',
98-
method: 'DELETE',
99-
path: '/emulator/v1/projects/not-a-project/databases/(default)/documents',
100-
port: '8080'
101-
})).to.be.true;
94+
await test.firestore.clearFirestoreData({ projectId: 'not-a-project' });
95+
96+
expect(
97+
fakeHttpRequestMethod.calledOnceWith({
98+
hostname: 'not-local-host',
99+
method: 'DELETE',
100+
path:
101+
'/emulator/v1/projects/not-a-project/databases/(default)/documents',
102+
port: '8080',
103+
})
104+
).to.be.true;
102105
});
103106

104107
it('should use host name from FIREBASE_FIRESTORE_EMULATOR_ADDRESS env in clearFirestoreData', async () => {
105108
process.env.FIREBASE_FIRESTORE_EMULATOR_ADDRESS = 'custom-host:9090';
106109

107-
await test.firestore.clearFirestoreData({projectId: 'not-a-project'});
108-
109-
expect(fakeHttpRequestMethod.calledOnceWith({
110-
hostname: 'custom-host',
111-
method: 'DELETE',
112-
path: '/emulator/v1/projects/not-a-project/databases/(default)/documents',
113-
port: '9090'
114-
})).to.be.true;
110+
await test.firestore.clearFirestoreData({ projectId: 'not-a-project' });
111+
112+
expect(
113+
fakeHttpRequestMethod.calledOnceWith({
114+
hostname: 'custom-host',
115+
method: 'DELETE',
116+
path:
117+
'/emulator/v1/projects/not-a-project/databases/(default)/documents',
118+
port: '9090',
119+
})
120+
).to.be.true;
115121
});
116122
});

0 commit comments

Comments
 (0)