Skip to content

Commit b758ec5

Browse files
bkendallhuangjeff5
andauthored
upgrade sinon and fix a few usages (#3040)
Co-authored-by: huangjeff5 <[email protected]>
1 parent c0f532a commit b758ec5

File tree

5 files changed

+88
-76
lines changed

5 files changed

+88
-76
lines changed

package-lock.json

Lines changed: 73 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"@types/request": "^2.48.1",
163163
"@types/rimraf": "^2.0.3",
164164
"@types/semver": "^6.0.0",
165-
"@types/sinon": "^5.0.5",
165+
"@types/sinon": "^9.0.10",
166166
"@types/sinon-chai": "^3.2.2",
167167
"@types/supertest": "^2.0.6",
168168
"@types/tar": "^4.0.0",
@@ -194,7 +194,7 @@
194194
"openapi-merge": "^1.0.23",
195195
"prettier": "^2.2.1",
196196
"proxy": "^1.0.2",
197-
"sinon": "^6.3.4",
197+
"sinon": "^9.2.3",
198198
"sinon-chai": "^3.2.0",
199199
"source-map-support": "^0.5.9",
200200
"supertest": "^3.3.0",

src/test/appdistro/client.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ describe("distribution", () => {
7676
it("should throw error when retry count >= AppDistributionClient.MAX_POLLING_RETRIES", () => {
7777
sandbox.stub(appDistributionClient, "getUploadStatus").resolves({
7878
status: UploadStatus.IN_PROGRESS,
79+
message: "",
80+
errorCode: "",
81+
release: { id: "" },
7982
});
8083
return expect(
8184
appDistributionClient.pollUploadStatus(
@@ -93,6 +96,8 @@ describe("distribution", () => {
9396
const releaseId = "fake-release-id";
9497
sandbox.stub(appDistributionClient, "getUploadStatus").resolves({
9598
status: UploadStatus.SUCCESS,
99+
message: "",
100+
errorCode: "",
96101
release: {
97102
id: releaseId,
98103
},

src/test/extensions/extensionsHelper.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as resolveSource from "../../extensions/resolveSource";
88
import { storage } from "../../gcp";
99
import * as archiveDirectory from "../../archiveDirectory";
1010
import * as prompt from "../../prompt";
11+
import { ExtensionSource } from "../../extensions/extensionsApi";
1112

1213
describe("extensionsHelper", () => {
1314
describe("substituteParams", () => {
@@ -687,12 +688,14 @@ describe("extensionsHelper", () => {
687688
let createSourceStub: sinon.SinonStub;
688689
let deleteStub: sinon.SinonStub;
689690
const testUrl = "https://storage.googleapis.com/firebase-ext-eap-uploads/object.zip";
690-
const testSource = {
691+
const testSource: ExtensionSource = {
691692
name: "test",
692693
packageUri: testUrl,
693694
hash: "abc123",
695+
state: "ACTIVE",
694696
spec: {
695697
name: "projects/test-proj/sources/abc123",
698+
version: "0.0.0",
696699
sourceUrl: testUrl,
697700
resources: [],
698701
},
@@ -775,12 +778,14 @@ describe("extensionsHelper", () => {
775778
"0.1.1": testOnePlatformSourceName,
776779
},
777780
};
778-
const testSource = {
781+
const testSource: ExtensionSource = {
779782
name: "test",
780783
packageUri: "",
781784
hash: "abc123",
785+
state: "ACTIVE",
782786
spec: {
783787
name: "",
788+
version: "0.0.0",
784789
sourceUrl: "",
785790
resources: [],
786791
},

src/test/extensions/resolveSource.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe("checkForUpdateWarnings", () => {
4747
let confirmUpdateWarningSpy: sinon.SinonStub;
4848

4949
beforeEach(() => {
50-
confirmUpdateWarningSpy = sinon.stub(resolveSource, "confirmUpdateWarning").resolves(true);
50+
confirmUpdateWarningSpy = sinon.stub(resolveSource, "confirmUpdateWarning").resolves();
5151
});
5252

5353
afterEach(() => {

0 commit comments

Comments
 (0)