File tree Expand file tree Collapse file tree 5 files changed +11
-22
lines changed Expand file tree Collapse file tree 5 files changed +11
-22
lines changed 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-
17- nock . disableNetConnect ( ) ;
6+ nock . disableNetConnect ( ) ;
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 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 99 "stripInternal" : true ,
1010 "target" : " es2022" ,
1111 "useDefineForClassFields" : false ,
12+ "esModuleInterop" : true ,
1213 "typeRoots" : [" ./node_modules/@types" ]
1314 },
1415 "files" : [
You can’t perform that action at this time.
0 commit comments