mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
fix outdated targetplatforms in web
This commit is contained in:
parent
3e5c7e2c57
commit
bcbf1684e2
|
@ -221,7 +221,11 @@ export class Extension implements IExtension {
|
|||
}
|
||||
|
||||
get outdatedTargetPlatform(): boolean {
|
||||
return !!this.local && !!this.gallery && this.local.targetPlatform !== TargetPlatform.UNDEFINED && this.local.targetPlatform !== this.gallery.properties.targetPlatform && semver.eq(this.latestVersion, this.version);
|
||||
return !!this.local && !!this.gallery
|
||||
&& ![TargetPlatform.UNDEFINED, TargetPlatform.WEB].includes(this.local.targetPlatform)
|
||||
&& this.gallery.properties.targetPlatform !== TargetPlatform.WEB
|
||||
&& this.local.targetPlatform !== this.gallery.properties.targetPlatform
|
||||
&& semver.eq(this.latestVersion, this.version);
|
||||
}
|
||||
|
||||
get telemetryData(): any {
|
||||
|
|
|
@ -56,6 +56,16 @@ suite('Extension Test', () => {
|
|||
assert.strictEqual(extension.outdated, true);
|
||||
});
|
||||
|
||||
test('extension is not outdated when local and gallery are on same version and local is on web', () => {
|
||||
const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, undefined, aLocalExtension('somext', {}, { targetPlatform: TargetPlatform.WEB }), aGalleryExtension('somext'));
|
||||
assert.strictEqual(extension.outdated, false);
|
||||
});
|
||||
|
||||
test('extension is not outdated when local and gallery are on same version and gallery is on web', () => {
|
||||
const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, undefined, aLocalExtension('somext'), aGalleryExtension('somext', {}, { targetPlatform: TargetPlatform.WEB }));
|
||||
assert.strictEqual(extension.outdated, false);
|
||||
});
|
||||
|
||||
test('extension is not outdated when local is not pre-release but gallery is pre-release', () => {
|
||||
const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, undefined, aLocalExtension('somext', { version: '1.0.0' }), aGalleryExtension('somext', { version: '1.0.1' }, { isPreReleaseVersion: true }));
|
||||
assert.strictEqual(extension.outdated, false);
|
||||
|
|
Loading…
Reference in a new issue