fix(supported-versions): nightly build matrix tag (#152)

This commit is contained in:
Damien Retzinger
2023-09-24 16:07:37 -04:00
committed by GitHub
parent 88901eacf7
commit 7f1821f6ac
10 changed files with 326 additions and 48 deletions
@@ -0,0 +1,32 @@
import { unifyNextPackageName } from "./unify-next-package-name";
describe('unifyNextPackageName', () => {
it('should do nothing to an unknown package', () => {
expect(unifyNextPackageName('test', 'https://repo.mage-os.org', new Date())).toEqual('test');
});
it('should do nothing to a next-available package at a non-next version', () => {
expect(
unifyNextPackageName('magento/product-community-edition:v2.4.5-p1', 'https://repo.mage-os.org', new Date())
)
.toEqual('magento/product-community-edition:v2.4.5-p1');
});
it('should do nothing to a next package at a next version on a repo that doesnt support that version', () => {
expect(
unifyNextPackageName('magento/product-community-edition:next', 'https://repo.mage-os.org', new Date())
).toEqual('magento/product-community-edition:next');
});
it('should convert the next version to the specific format of the repo that supports the next version', () => {
expect(
unifyNextPackageName('magento/product-community-edition:next', 'https://upstream-nightly.mage-os.org', new Date())
).toEqual('magento/product-community-edition:@alpha');
});
it('should convert the next version to the specific format of the repo that supports the next version', () => {
expect(
unifyNextPackageName('mage-os/product-community-edition:next', 'https://nightly.mage-os.org', new Date())
).toEqual('mage-os/product-community-edition:@alpha');
});
});