diff options
author | 2023-12-05 16:23:18 +0000 | |
---|---|---|
committer | 2023-12-05 16:23:18 +0000 | |
commit | 874f68c67f588f37b5ad4a698d5c32e1667292dd (patch) | |
tree | 3195bcd9c38648204ec9c879b0d3187a996a7816 | |
parent | d1c91add074c2e08056f01df5a6043c9716b7e1f (diff) | |
download | astro-874f68c67f588f37b5ad4a698d5c32e1667292dd.tar.gz astro-874f68c67f588f37b5ad4a698d5c32e1667292dd.tar.zst astro-874f68c67f588f37b5ad4a698d5c32e1667292dd.zip |
[ci] format
-rw-r--r-- | packages/upgrade/test/verify.test.js | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/packages/upgrade/test/verify.test.js b/packages/upgrade/test/verify.test.js index ec9d2de58..a54cb6bb5 100644 --- a/packages/upgrade/test/verify.test.js +++ b/packages/upgrade/test/verify.test.js @@ -7,60 +7,70 @@ describe('collectPackageInfo', () => { version: 'latest', packageManager: 'npm', dryRun: true, - packages: [] + packages: [], }; beforeEach(() => { context.packages = []; - }) + }); it('detects astro', async () => { - collectPackageInfo(context, { "astro": "1.0.0" }, {}); - expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '1.0.0', targetVersion: 'latest' }]); + collectPackageInfo(context, { astro: '1.0.0' }, {}); + expect(context.packages).deep.equal([ + { name: 'astro', currentVersion: '1.0.0', targetVersion: 'latest' }, + ]); }); it('detects @astrojs', async () => { - collectPackageInfo(context, { "@astrojs/preact": "1.0.0" }, {}); - expect(context.packages).deep.equal([{ name: '@astrojs/preact', currentVersion: '1.0.0', targetVersion: 'latest' }]); + collectPackageInfo(context, { '@astrojs/preact': '1.0.0' }, {}); + expect(context.packages).deep.equal([ + { name: '@astrojs/preact', currentVersion: '1.0.0', targetVersion: 'latest' }, + ]); }); it('supports ^ prefixes', async () => { - collectPackageInfo(context, { "astro": "^1.0.0" }, {}); - expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '^1.0.0', targetVersion: 'latest' }]); + collectPackageInfo(context, { astro: '^1.0.0' }, {}); + expect(context.packages).deep.equal([ + { name: 'astro', currentVersion: '^1.0.0', targetVersion: 'latest' }, + ]); }); it('supports ~ prefixes', async () => { - collectPackageInfo(context, { "astro": "~1.0.0" }, {}); - expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '~1.0.0', targetVersion: 'latest' }]); + collectPackageInfo(context, { astro: '~1.0.0' }, {}); + expect(context.packages).deep.equal([ + { name: 'astro', currentVersion: '~1.0.0', targetVersion: 'latest' }, + ]); }); it('supports prereleases', async () => { - collectPackageInfo(context, { "astro": "1.0.0-beta.0" }, {}); - expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '1.0.0-beta.0', targetVersion: 'latest' }]); + collectPackageInfo(context, { astro: '1.0.0-beta.0' }, {}); + expect(context.packages).deep.equal([ + { name: 'astro', currentVersion: '1.0.0-beta.0', targetVersion: 'latest' }, + ]); }); it('ignores self', async () => { - collectPackageInfo(context, { "@astrojs/upgrade": "0.0.1" }, {}); + collectPackageInfo(context, { '@astrojs/upgrade': '0.0.1' }, {}); expect(context.packages).deep.equal([]); }); it('ignores linked packages', async () => { - collectPackageInfo(context, { "@astrojs/preact": "link:../packages/preact" }, {}); + collectPackageInfo(context, { '@astrojs/preact': 'link:../packages/preact' }, {}); expect(context.packages).deep.equal([]); }); it('ignores workspace packages', async () => { - collectPackageInfo(context, { "@astrojs/preact": "workspace:*" }, {}); + collectPackageInfo(context, { '@astrojs/preact': 'workspace:*' }, {}); expect(context.packages).deep.equal([]); }); it('ignores github packages', async () => { - collectPackageInfo(context, { "@astrojs/preact": "github:withastro/astro" }, {}); + collectPackageInfo(context, { '@astrojs/preact': 'github:withastro/astro' }, {}); expect(context.packages).deep.equal([]); }); it('ignores tag', async () => { - collectPackageInfo(context, { "@astrojs/preact": "beta" }, {}); + collectPackageInfo(context, { '@astrojs/preact': 'beta' }, {}); expect(context.packages).deep.equal([]); }); }); |