Skip to content
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

chore: Update Typescript to 4.x #1541

Merged
merged 1 commit into from
Jan 14, 2022
Merged
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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"sinon": "^9.0.0",
"sinon-chai": "^3.0.0",
"ts-node": "^10.2.0",
"typescript": "^3.7.3",
"typescript": "^4.4.3",
"yargs": "^17.0.1"
}
}
12 changes: 6 additions & 6 deletions test/integration/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ describe('admin.auth', () => {
const actualTenantObj = actualTenant.toJSON();
if (authEmulatorHost) {
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete expectedCreatedTenant.testPhoneNumbers;
}
expect(actualTenantObj).to.deep.equal(expectedCreatedTenant);
Expand Down Expand Up @@ -1617,7 +1617,7 @@ describe('admin.auth', () => {
const actualTenantObj = actualTenant.toJSON();
if (authEmulatorHost) {
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete expectedCreatedTenant.testPhoneNumbers;
}
expect(actualTenantObj).to.deep.equal(expectedCreatedTenant);
Expand Down Expand Up @@ -1649,15 +1649,15 @@ describe('admin.auth', () => {
.then((actualTenant) => {
const actualTenantObj = actualTenant.toJSON();
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete expectedUpdatedTenant.testPhoneNumbers;
expect(actualTenantObj).to.deep.equal(expectedUpdatedTenant);
return getAuth().tenantManager().updateTenant(createdTenantId, updatedOptions2);
})
.then((actualTenant) => {
const actualTenantObj = actualTenant.toJSON();
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete expectedUpdatedTenant2.testPhoneNumbers;
expect(actualTenantObj).to.deep.equal(expectedUpdatedTenant2);
});
Expand Down Expand Up @@ -2150,8 +2150,8 @@ describe('admin.auth', () => {
// Not supported in ID token,
delete decodedIdToken.nonce;
// exp and iat may vary depending on network connection latency.
delete decodedIdToken.exp;
delete decodedIdToken.iat;
delete (decodedIdToken as any).exp;
delete (decodedIdToken as any).iat;
expect(decodedIdToken).to.deep.equal(payloadClaims);
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/unit/auth/tenant.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ describe('Tenant', () => {
it('should return the expected server request without multi-factor and phone config', () => {
const tenantOptionsClientRequest = deepCopy(clientRequestWithoutMfa);
const tenantOptionsServerRequest = deepCopy(serverRequestWithoutMfa);
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;
expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
.to.deep.equal(tenantOptionsServerRequest);
});

it('should return the expected server request with multi-factor and phone config', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;
expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
.to.deep.equal(tenantOptionsServerRequest);
});
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('Tenant', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
tenantOptionsClientRequest.testPhoneNumbers = null;
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;
tenantOptionsServerRequest.testPhoneNumbers = {};

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('Tenant', () => {
it('should return the expected server request without multi-factor and phone config', () => {
const tenantOptionsClientRequest: CreateTenantRequest = deepCopy(clientRequestWithoutMfa);
const tenantOptionsServerRequest: TenantServerResponse = deepCopy(serverRequestWithoutMfa);
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest))
.to.deep.equal(tenantOptionsServerRequest);
Expand All @@ -190,7 +190,7 @@ describe('Tenant', () => {
it('should return the expected server request with multi-factor and phone config', () => {
const tenantOptionsClientRequest: CreateTenantRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest: TenantServerResponse = deepCopy(serverRequest);
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest))
.to.deep.equal(tenantOptionsServerRequest);
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('Tenant', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
tenantOptionsClientRequest.testPhoneNumbers = null;
delete tenantOptionsServerRequest.name;
delete (tenantOptionsServerRequest as any).name;
tenantOptionsServerRequest.testPhoneNumbers = {};

expect(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/security-rules/security-rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ describe('SecurityRules', () => {

it('should resolve with RulesetMetadataList when the response contains no page token', () => {
const response = deepCopy(LIST_RULESETS_RESPONSE);
delete response.nextPageToken;
delete (response as any).nextPageToken;
const stub = sinon
.stub(SecurityRulesApiClient.prototype, 'listRulesets')
.resolves(response);
Expand Down