summaryrefslogtreecommitdiff
path: root/packages/upgrade/test/context.test.js
blob: 5b6b8c6b22018c4042e06cfbf3074a8c02f12807 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { expect } from 'chai';
import { getContext } from '../dist/index.js';

describe('context', () => {
	it('no arguments', async () => {
		const ctx = await getContext([]);
		expect(ctx.version).to.eq('latest');
		expect(ctx.dryRun).to.be.undefined;
	});
	it('tag', async () => {
		const ctx = await getContext(['beta']);
		expect(ctx.version).to.eq('beta');
		expect(ctx.dryRun).to.be.undefined;
	});
	it('dry run', async () => {
		const ctx = await getContext(['--dry-run']);
		expect(ctx.dryRun).to.eq(true);
	});
});