Skip to content

enable esModuleInterop in tsconfig to fix import issue #1825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ following credentials from the project:
1. *Service account certificate*: This can be downloaded as a JSON file from
the "Settings > Service Accounts" tab of the Firebase console. Copy the
file into the repo so it's available at `test/resources/key.json`.
2. *Web API key*: This is displayed in the "Settings > General" tab of the
2. *Web API key*: This is displayed in the "Settings > General > Your apps > Config" tab of the
console. Copy it and save to a new text file at `test/resources/apikey.txt`.

Then set up your Firebase/Google Cloud project as follows:
Expand Down
2 changes: 1 addition & 1 deletion src/app/credential-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import fs = require('fs');
import os = require('os');
import path = require('path');
import path from 'path';

import { Agent } from 'http';
import { Credential, GoogleOAuthAccessToken } from './credential';
Expand Down
4 changes: 2 additions & 2 deletions src/utils/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import * as validator from './validator';
import * as jwt from 'jsonwebtoken';
import * as jwks from 'jwks-rsa';
import jwt from 'jsonwebtoken';
import jwks from 'jwks-rsa';
import { HttpClient, HttpRequestConfig, HttpError } from '../utils/api-request';
import { Agent } from 'http';

Expand Down
12 changes: 6 additions & 6 deletions test/integration/app-check.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

import * as _ from 'lodash';
import * as admin from '../../lib/index';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import fs = require('fs');
import path = require('path');
import _ from 'lodash';
import admin from '../../lib/index';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import fs from 'fs';
import path from 'path';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const chalk = require('chalk');
Expand Down
12 changes: 6 additions & 6 deletions test/integration/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import url = require('url');
import * as crypto from 'crypto';
import * as bcrypt from 'bcrypt';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import url from 'url';
import crypto from 'crypto';
import bcrypt from 'bcrypt';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import firebase from '@firebase/app-compat';
import '@firebase/auth-compat';
import { clone } from 'lodash';
Expand Down Expand Up @@ -551,7 +551,7 @@ describe('admin.auth', () => {
// each attempt). Occassionally, this call retrieves the user data
// without the lastLoginTime/lastRefreshTime set; possibly because
// it's hitting a different server than the login request uses.
let userRecord = null;
let userRecord:UserRecord|null = null;

for (let i = 0; i < 3; i++) {
userRecord = await getAuth().getUser('lastRefreshTimeUser');
Expand Down
4 changes: 2 additions & 2 deletions test/integration/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import * as admin from '../../lib/index';
import {
Database, DataSnapshot, EventType, Reference, ServerValue, getDatabase, getDatabaseWithUrl,
Expand Down
6 changes: 3 additions & 3 deletions test/integration/firestore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { clone } from 'lodash';
import * as admin from '../../lib/index';
import {
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('admin.firestore', () => {
const data = snapshot.data();
expect(data).to.exist;
expect(data!.sisterCity.path).to.deep.equal(source.path);
const promises = [];
const promises:Promise<admin.firestore.WriteResult>[] = [];
promises.push(source.delete());
promises.push(target.delete());
return Promise.all(promises);
Expand Down
4 changes: 2 additions & 2 deletions test/integration/functions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { getFunctions } from '../../lib/functions/index';

chai.should();
Expand Down
4 changes: 2 additions & 2 deletions test/integration/installations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import { getInstallations } from '../../lib/installations/index';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';

chai.should();
chai.use(chaiAsPromised);
Expand Down
4 changes: 2 additions & 2 deletions test/integration/instance-id.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { getInstanceId } from '../../lib/instance-id/index';

chai.should();
Expand Down
4 changes: 2 additions & 2 deletions test/integration/machine-learning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/


import path = require('path');
import * as chai from 'chai';
import path from 'path';
import chai from 'chai';
import { projectId } from './setup';
import { Bucket } from '@google-cloud/storage';
import { getStorage } from '../../lib/storage/index';
Expand Down
4 changes: 2 additions & 2 deletions test/integration/messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { Message, MulticastMessage, getMessaging } from '../../lib/messaging/index';

chai.should();
Expand Down
6 changes: 3 additions & 3 deletions test/integration/project-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

import * as _ from 'lodash';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { projectId } from './setup';
import {
AndroidApp, IosApp, ShaCertificate, getProjectManagement,
Expand Down
4 changes: 2 additions & 2 deletions test/integration/remote-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { deepCopy } from '../../src/utils/deep-copy';
import {
getRemoteConfig,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/security-rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as chai from 'chai';
import chai from 'chai';
import { Ruleset, RulesetMetadata, getSecurityRules } from '../../lib/security-rules/index';

const expect = chai.expect;
Expand Down
6 changes: 3 additions & 3 deletions test/integration/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

import fs = require('fs');
import minimist = require('minimist');
import path = require('path');
import fs from 'fs';
import minimist from 'minimist';
import path from 'path';
import { random } from 'lodash';
import {
App, Credential, GoogleOAuthAccessToken, cert, deleteApp, initializeApp,
Expand Down
4 changes: 2 additions & 2 deletions test/integration/storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { Bucket, File } from '@google-cloud/storage';

import { projectId } from './setup';
Expand Down
8 changes: 4 additions & 4 deletions test/resources/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
'use strict';

// Use untyped import syntax for Node built-ins.
import path = require('path');
import events = require('events');
import stream = require('stream');
import path from 'path';
import events from 'events';
import stream from 'stream';

import * as _ from 'lodash';
import _ from 'lodash';
import * as jwt from 'jsonwebtoken';

import { AppOptions } from '../../src/firebase-namespace-api';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/app-check/app-check-api-client-internal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

'use strict';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinon from 'sinon';
import _ from 'lodash';
import chai from 'chai';
import sinon from 'sinon';
import { HttpClient } from '../../../src/utils/api-request';
import * as utils from '../utils';
import * as mocks from '../../resources/mocks';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/app-check/app-check.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

'use strict';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinon from 'sinon';
import _ from 'lodash';
import chai from 'chai';
import sinon from 'sinon';
import * as mocks from '../../resources/mocks';

import { FirebaseApp } from '../../../src/app/firebase-app';
Expand Down
10 changes: 5 additions & 5 deletions test/unit/app-check/token-generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

'use strict';

import * as _ from 'lodash';
import _ from 'lodash';
import * as jwt from 'jsonwebtoken';
import * as chai from 'chai';
import * as sinon from 'sinon';
import * as sinonChai from 'sinon-chai';
import * as chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';
import * as mocks from '../../resources/mocks';

import {
Expand Down
8 changes: 4 additions & 4 deletions test/unit/app-check/token-verifier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

'use strict';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinon from 'sinon';
import _ from 'lodash';
import chai from 'chai';
import sinon from 'sinon';
import * as mocks from '../../resources/mocks';
import * as nock from 'nock';
import nock from 'nock';

import { AppCheckTokenVerifier } from '../../../src/app-check/token-verifier';
import { JwtError, JwtErrorCode, PublicKeySignatureVerifier } from '../../../src/utils/jwt';
Expand Down
18 changes: 9 additions & 9 deletions test/unit/app/credential-internal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
'use strict';

// Use untyped import syntax for Node built-ins
import fs = require('fs');
import path = require('path');

import * as _ from 'lodash';
import * as chai from 'chai';
import * as nock from 'nock';
import * as sinon from 'sinon';
import * as sinonChai from 'sinon-chai';
import * as chaiAsPromised from 'chai-as-promised';
import fs from 'fs';
import path from 'path';

import _ from 'lodash';
import chai from 'chai';
import nock from 'nock';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';

import * as utils from '../utils';
import * as mocks from '../../resources/mocks';
Expand Down
10 changes: 5 additions & 5 deletions test/unit/app/firebase-app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

'use strict';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinon from 'sinon';
import * as sinonChai from 'sinon-chai';
import * as chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import chai from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';

import * as utils from '../utils';
import * as mocks from '../../resources/mocks';
Expand Down
10 changes: 5 additions & 5 deletions test/unit/app/firebase-namespace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

'use strict';

import path = require('path');
import path from 'path';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinonChai from 'sinon-chai';
import * as chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import chai from 'chai';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';

import * as mocks from '../../resources/mocks';

Expand Down
10 changes: 5 additions & 5 deletions test/unit/app/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

'use strict';

import path = require('path');
import path from 'path';

import * as _ from 'lodash';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import * as mocks from '../../resources/mocks';
import * as sinon from 'sinon';
import sinon from 'sinon';

import {
initializeApp, getApp, getApps, deleteApp, SDK_VERSION,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/auth/action-code-settings-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinonChai from 'sinon-chai';
import * as chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import chai from 'chai';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';

import { ActionCodeSettingsBuilder } from '../../../src/auth/action-code-settings-builder';
import { AuthClientErrorCode } from '../../../src/utils/error';
Expand Down
Loading