File tree Expand file tree Collapse file tree 11 files changed +18
-36
lines changed
integration_test/functions/src Expand file tree Collapse file tree 11 files changed +18
-36
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { GoogleAuth } from "google-auth-library";
33import { Request , Response } from "express" ;
44import * as admin from "firebase-admin" ;
55import * as functions from "firebase-functions" ;
6- import * as fs from "fs" ;
6+ import fs from "fs" ;
77import fetch from "node-fetch" ;
88
99import * as v1 from "./v1" ;
Original file line number Diff line number Diff line change 1- import * as chai from "chai" ;
2- import * as chaiAsPromisedModule from "chai-as-promised" ;
3- import * as nockModule from "nock" ;
4-
5- // Normalize CommonJS exports so ts-node (Node.js 20) and Node.js 22's strip-only loader
6- // both receive callable modules without relying on esModuleInterop.
7- type ChaiPlugin = Parameters < typeof chai . use > [ 0 ] ;
8- type NockModule = typeof nockModule ;
9-
10- const chaiAsPromisedExport = chaiAsPromisedModule as ChaiPlugin & { default ?: ChaiPlugin } ;
11- const chaiAsPromised = chaiAsPromisedExport . default ?? chaiAsPromisedExport ;
12- const nockExport = nockModule as NockModule & { default ?: NockModule } ;
13- const nock = nockExport . default ?? nockExport ;
1+ import chai from "chai" ;
2+ import chaiAsPromised from "chai-as-promised" ;
3+ import nock from "nock" ;
144
155chai . use ( chaiAsPromised ) ;
16-
176nock . disableNetConnect ( ) ;
Original file line number Diff line number Diff line change 1- import * as chai from "chai" ;
2- import * as chaiAsPromisedModule from "chai-as-promised" ;
3-
4- // Match the runtime shim in mocha/setup.ts so bin tests work on Node.js 20 ts-node
5- // and Node.js 22's strip-only TypeScript loader without enabling esModuleInterop.
6- type ChaiPlugin = Parameters < typeof chai . use > [ 0 ] ;
7-
8- const chaiAsPromisedExport = chaiAsPromisedModule as ChaiPlugin & { default ?: ChaiPlugin } ;
9- const chaiAsPromised = chaiAsPromisedExport . default ?? chaiAsPromisedExport ;
1+ import chai from "chai" ;
2+ import chaiAsPromised from "chai-as-promised" ;
103
114chai . use ( chaiAsPromised ) ;
Original file line number Diff line number Diff line change 11import * as subprocess from "child_process" ;
22import * as path from "path" ;
33import { promisify } from "util" ;
4- import * as fs from "fs/promises" ;
4+ import fs from "fs/promises" ;
55import * as os from "os" ;
66
77import { expect } from "chai" ;
Original file line number Diff line number Diff line change 2121// SOFTWARE.
2222
2323import { expect } from "chai" ;
24- import * as fs from "fs" ;
25- import * as process from "process" ;
24+ import fs from "fs" ;
2625import * as sinon from "sinon" ;
2726
2827import { firebaseConfig , resetCache } from "../../src/common/config" ;
Original file line number Diff line number Diff line change 11import { EventEmitter } from 'node:stream' ;
22
3- import * as jwt from 'jsonwebtoken' ;
4- import * as jwkToPem from 'jwk-to-pem' ;
5- import * as nock from 'nock' ;
3+ import jwt from 'jsonwebtoken' ;
4+ import jwkToPem from 'jwk-to-pem' ;
5+ import nock from 'nock' ;
66import * as mockJWK from '../fixtures/credential/jwk.json' ;
77import * as mockKey from '../fixtures/credential/key.json' ;
88
Original file line number Diff line number Diff line change 2323// SOFTWARE.
2424
2525import * as http from "http" ;
26- import * as express from "express" ;
27- import * as fs from "fs/promises" ;
26+ import express from "express" ;
27+ import fs from "fs/promises" ;
2828import * as path from "path" ;
2929import { loadStack } from "../runtime/loader" ;
3030import { stackToWire } from "../runtime/manifest" ;
Original file line number Diff line number Diff line change 11import { AppOptions } from "firebase-admin/app" ;
2- import { readFileSync } from "fs" ;
2+ import fs from "fs" ;
33import * as path from "path" ;
44
55import * as logger from "../logger" ;
@@ -29,7 +29,7 @@ export function firebaseConfig(): AppOptions | null {
2929 // explicitly state that the user can set the env to a file:
3030 // https://firebase.google.com/docs/admin/setup#initialize-without-parameters
3131 if ( ! env . startsWith ( "{" ) ) {
32- env = readFileSync ( path . join ( process . env . PWD , env ) ) . toString ( "utf8" ) ;
32+ env = fs . readFileSync ( path . join ( process . env . PWD , env ) ) . toString ( "utf8" ) ;
3333 }
3434
3535 cache = JSON . parse ( env ) ;
Original file line number Diff line number Diff line change 2020// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121// SOFTWARE.
2222
23- import * as cors from "cors" ;
23+ import cors from "cors" ;
2424import * as express from "express" ;
2525import { DecodedAppCheckToken } from "firebase-admin/app-check" ;
2626
Original file line number Diff line number Diff line change 2525 * @packageDocumentation
2626 */
2727
28- import * as cors from "cors" ;
28+ import cors from "cors" ;
2929import * as express from "express" ;
3030import { convertIfPresent , convertInvoker , copyIfPresent } from "../../common/encoding" ;
3131import { wrapTraceContext } from "../trace" ;
You can’t perform that action at this time.
0 commit comments