Skip to content

Commit

Permalink
Add missing changelog entry for #3499 (#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjeff5 committed Jun 16, 2021
1 parent ac875c4 commit 497728d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes an issue with ext:update where local extension is incorrectly inferred as published (#3499)
8 changes: 8 additions & 0 deletions src/test/extensions/updateHelper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,38 +599,44 @@ describe("getExistingSourceOrigin", () => {
isOfficialStub = sinon.stub(resolveSource, "isOfficialSource");
isOfficialStub.returns(true);
getInstanceStub = sinon.stub(extensionsApi, "getInstance").resolves(INSTANCE);

const result = await updateHelper.getExistingSourceOrigin(
"invader-zim",
"instance-of-official-ext",
"ext-testing",
"projects/firebasemods/sources/fake-official-source"
);

expect(result).to.equal(extensionsHelper.SourceOrigin.OFFICIAL_EXTENSION);
});

it("should return published extension as source origin", async () => {
registryEntryStub = sinon.stub(resolveSource, "resolveRegistryEntry");
registryEntryStub.throwsException("Entry not found");
getInstanceStub = sinon.stub(extensionsApi, "getInstance").resolves(REGISTRY_INSTANCE);

const result = await updateHelper.getExistingSourceOrigin(
"invader-zim",
"instance-of-registry-ext",
"ext-testing",
"projects/firebasemods/sources/fake-registry-source"
);

expect(result).to.equal(extensionsHelper.SourceOrigin.PUBLISHED_EXTENSION);
});

it("should return local extension as source origin", async () => {
registryEntryStub = sinon.stub(resolveSource, "resolveRegistryEntry");
registryEntryStub.throwsException("Entry not found");
getInstanceStub = sinon.stub(extensionsApi, "getInstance").resolves(LOCAL_INSTANCE);

const result = await updateHelper.getExistingSourceOrigin(
"invader-zim",
"instance-of-local-ext",
"ext-testing",
"projects/firebasemods/sources/fake-local-source"
);

expect(result).to.equal(extensionsHelper.SourceOrigin.LOCAL);
});

Expand All @@ -640,12 +646,14 @@ describe("getExistingSourceOrigin", () => {
isOfficialStub = sinon.stub(resolveSource, "isOfficialSource");
isOfficialStub.returns(false);
getInstanceStub = sinon.stub(extensionsApi, "getInstance").resolves(LOCAL_INSTANCE);

const result = await updateHelper.getExistingSourceOrigin(
"invader-zim",
"instance-of-local-ext",
"ext-testing",
"projects/firebasemods/sources/fake-local-source"
);

expect(result).to.equal(extensionsHelper.SourceOrigin.LOCAL);
});
});

0 comments on commit 497728d

Please sign in to comment.