Skip to content

Commit 1262459

Browse files
committed
Update firebase-admin and firebase-functions and fix jest tests
1 parent 26df4e1 commit 1262459

File tree

12 files changed

+435
-406
lines changed

12 files changed

+435
-406
lines changed

components/db/useUpcoming.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @jest-environment node
3+
*/
4+
15
import { renderHook, waitFor } from "@testing-library/react"
26
import { terminateFirebase, testDb, testTimestamp } from "../../tests/testUtils"
37
import { useUpcomingBills } from "./useUpcomingBills"

functions/jest.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
22
module.exports = {
33
preset: "ts-jest",
4-
testEnvironment: "node"
5-
}
4+
testEnvironment: "node",
5+
moduleNameMapper: {
6+
// This maps firebase-admin/auth to the correct location within node_modules
7+
"^firebase-admin/auth$": "<rootDir>/node_modules/firebase-admin/lib/auth/index.js",
8+
"^firebase-admin/app$": "<rootDir>/node_modules/firebase-admin/lib/app/index.js",
9+
"^firebase-admin/(.*)$": "<rootDir>/node_modules/firebase-admin/lib/$1",
10+
},
11+
};

functions/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"assemblyai": "^4.9.0",
1919
"axios": "^0.25.0",
2020
"date-fns": "^2.30.0",
21-
"firebase-admin": "^10",
22-
"firebase-functions": "^4.9.0",
21+
"firebase-admin": "^11.11.1",
22+
"firebase-functions": "^5.1.1",
2323
"fluent-ffmpeg": "^2.1.3",
2424
"fuse.js": "6.5.3",
2525
"handlebars": "^4.7.8",
@@ -49,4 +49,4 @@
4949
"typescript": "4.5.5"
5050
},
5151
"private": true
52-
}
52+
}

functions/yarn.lock

Lines changed: 148 additions & 167 deletions
Large diffs are not rendered by default.

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const config = {
1111
coverageProvider: "v8",
1212
testEnvironment: "jsdom",
1313
moduleNameMapper: {
14-
"^components/(.*)$": "<rootDir>/components/$1"
14+
"^components/(.*)$": "<rootDir>/components/$1",
15+
// This maps firebase-admin/auth to the correct location within node_modules
16+
"^firebase-admin/auth$": "<rootDir>/node_modules/firebase-admin/lib/auth/index.js",
17+
"^firebase-admin/app$": "<rootDir>/node_modules/firebase-admin/lib/app/index.js",
18+
"^firebase-admin/(.*)$": "<rootDir>/node_modules/firebase-admin/lib/$1",
1519
}
1620
// Add more setup options before each test is run
1721
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"eslint-plugin-i18next": "^6.0.3",
177177
"eslint-plugin-jsx-a11y": "^6.9.0",
178178
"file-loader": "^6.2.0",
179-
"firebase-admin": "^10",
179+
"firebase-admin": "^11.11.1",
180180
"firebase-tools": "^12.4.0",
181181
"ini": "^1.3.5",
182182
"inquirer": "^6.5.1",
@@ -200,4 +200,4 @@
200200
"resolutions": {
201201
"jackspeak": "2.1.1"
202202
}
203-
}
203+
}

tests/integration/backfillTestimonyCounts.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @jest-environment node
3+
*/
14
import { waitFor } from "@testing-library/react"
25
import axios from "axios"
36
import { currentGeneralCourt } from "functions/src/shared"

tests/integration/profile.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @jest-environment node
3+
*/
14
import { waitFor } from "@testing-library/react"
25
import { signInWithEmailAndPassword } from "firebase/auth"
36
import { deleteDoc, doc, getDoc, setDoc, updateDoc } from "firebase/firestore"

tests/integration/search.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @jest-environment node
3+
*/
14
import { DocumentSnapshot } from "@google-cloud/firestore"
25
import { waitFor } from "@testing-library/react"
36
import axios from "axios"

tests/integration/testimony.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @jest-environment node
3+
*/
14
import { currentGeneralCourt } from "functions/src/shared"
25
import { getAuth, signOut, User } from "firebase/auth"
36
import { doc, getDoc, setDoc, Timestamp, updateDoc } from "firebase/firestore"

0 commit comments

Comments
 (0)