mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
[ci] format
This commit is contained in:
parent
d1c91add07
commit
874f68c67f
1 changed files with 27 additions and 17 deletions
|
@ -7,60 +7,70 @@ describe('collectPackageInfo', () => {
|
||||||
version: 'latest',
|
version: 'latest',
|
||||||
packageManager: 'npm',
|
packageManager: 'npm',
|
||||||
dryRun: true,
|
dryRun: true,
|
||||||
packages: []
|
packages: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
context.packages = [];
|
context.packages = [];
|
||||||
})
|
});
|
||||||
|
|
||||||
it('detects astro', async () => {
|
it('detects astro', async () => {
|
||||||
collectPackageInfo(context, { "astro": "1.0.0" }, {});
|
collectPackageInfo(context, { astro: '1.0.0' }, {});
|
||||||
expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '1.0.0', targetVersion: 'latest' }]);
|
expect(context.packages).deep.equal([
|
||||||
|
{ name: 'astro', currentVersion: '1.0.0', targetVersion: 'latest' },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('detects @astrojs', async () => {
|
it('detects @astrojs', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/preact": "1.0.0" }, {});
|
collectPackageInfo(context, { '@astrojs/preact': '1.0.0' }, {});
|
||||||
expect(context.packages).deep.equal([{ name: '@astrojs/preact', currentVersion: '1.0.0', targetVersion: 'latest' }]);
|
expect(context.packages).deep.equal([
|
||||||
|
{ name: '@astrojs/preact', currentVersion: '1.0.0', targetVersion: 'latest' },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports ^ prefixes', async () => {
|
it('supports ^ prefixes', async () => {
|
||||||
collectPackageInfo(context, { "astro": "^1.0.0" }, {});
|
collectPackageInfo(context, { astro: '^1.0.0' }, {});
|
||||||
expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '^1.0.0', targetVersion: 'latest' }]);
|
expect(context.packages).deep.equal([
|
||||||
|
{ name: 'astro', currentVersion: '^1.0.0', targetVersion: 'latest' },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports ~ prefixes', async () => {
|
it('supports ~ prefixes', async () => {
|
||||||
collectPackageInfo(context, { "astro": "~1.0.0" }, {});
|
collectPackageInfo(context, { astro: '~1.0.0' }, {});
|
||||||
expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '~1.0.0', targetVersion: 'latest' }]);
|
expect(context.packages).deep.equal([
|
||||||
|
{ name: 'astro', currentVersion: '~1.0.0', targetVersion: 'latest' },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports prereleases', async () => {
|
it('supports prereleases', async () => {
|
||||||
collectPackageInfo(context, { "astro": "1.0.0-beta.0" }, {});
|
collectPackageInfo(context, { astro: '1.0.0-beta.0' }, {});
|
||||||
expect(context.packages).deep.equal([{ name: 'astro', currentVersion: '1.0.0-beta.0', targetVersion: 'latest' }]);
|
expect(context.packages).deep.equal([
|
||||||
|
{ name: 'astro', currentVersion: '1.0.0-beta.0', targetVersion: 'latest' },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ignores self', async () => {
|
it('ignores self', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/upgrade": "0.0.1" }, {});
|
collectPackageInfo(context, { '@astrojs/upgrade': '0.0.1' }, {});
|
||||||
expect(context.packages).deep.equal([]);
|
expect(context.packages).deep.equal([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ignores linked packages', async () => {
|
it('ignores linked packages', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/preact": "link:../packages/preact" }, {});
|
collectPackageInfo(context, { '@astrojs/preact': 'link:../packages/preact' }, {});
|
||||||
expect(context.packages).deep.equal([]);
|
expect(context.packages).deep.equal([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ignores workspace packages', async () => {
|
it('ignores workspace packages', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/preact": "workspace:*" }, {});
|
collectPackageInfo(context, { '@astrojs/preact': 'workspace:*' }, {});
|
||||||
expect(context.packages).deep.equal([]);
|
expect(context.packages).deep.equal([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ignores github packages', async () => {
|
it('ignores github packages', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/preact": "github:withastro/astro" }, {});
|
collectPackageInfo(context, { '@astrojs/preact': 'github:withastro/astro' }, {});
|
||||||
expect(context.packages).deep.equal([]);
|
expect(context.packages).deep.equal([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('ignores tag', async () => {
|
it('ignores tag', async () => {
|
||||||
collectPackageInfo(context, { "@astrojs/preact": "beta" }, {});
|
collectPackageInfo(context, { '@astrojs/preact': 'beta' }, {});
|
||||||
expect(context.packages).deep.equal([]);
|
expect(context.packages).deep.equal([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue