import { expect } from '../../../test-utils'; import { isWorkbenchOutdated } from '../version-check'; describe('isWorkbenchOutdated', function () { it('flags a build that is strictly behind the published latest', function () { expect(isWorkbenchOutdated('2.1.3', '2.1.4')).to.equal(true); expect(isWorkbenchOutdated('2.0.5', '2.1.0')).to.equal(true); expect(isWorkbenchOutdated('1.9.9', '2.0.0')).to.equal(true); }); it('does NOT flag a build that equals the published latest', function () { expect(isWorkbenchOutdated('2.1.4', '2.1.4')).to.equal(false); }); it('does NOT flag a local/unreleased build that is ahead of the published latest', function () { // The bug this fixes: linking a newer local build (2.1.4) while npm latest is 2.1.3. expect(isWorkbenchOutdated('2.1.4', '2.1.3')).to.equal(false); expect(isWorkbenchOutdated('3.0.0', '2.9.9')).to.equal(false); }); it('never blocks on an unparseable version (cannot compare → treat as not outdated)', function () { expect(isWorkbenchOutdated('2.1.x', '2.1.3')).to.equal(false); expect(isWorkbenchOutdated('2.1.3', 'latest')).to.equal(false); }); });