2024-01-12 02:53:00 -05:00
|
|
|
import * as assert from 'node:assert/strict';
|
|
|
|
import { describe, it } from 'node:test';
|
2023-11-27 18:00:59 -05:00
|
|
|
import { getContext } from '../dist/index.js';
|
|
|
|
|
|
|
|
describe('context', () => {
|
|
|
|
it('no arguments', async () => {
|
|
|
|
const ctx = await getContext([]);
|
2024-01-12 02:53:00 -05:00
|
|
|
assert.equal(ctx.version, 'latest');
|
|
|
|
assert.equal(ctx.dryRun, undefined);
|
2023-11-27 18:00:59 -05:00
|
|
|
});
|
|
|
|
it('tag', async () => {
|
|
|
|
const ctx = await getContext(['beta']);
|
2024-01-12 02:53:00 -05:00
|
|
|
assert.equal(ctx.version, 'beta');
|
|
|
|
assert.equal(ctx.dryRun, undefined);
|
2023-11-27 18:00:59 -05:00
|
|
|
});
|
|
|
|
it('dry run', async () => {
|
|
|
|
const ctx = await getContext(['--dry-run']);
|
2024-01-12 02:53:00 -05:00
|
|
|
assert.equal(ctx.dryRun, true);
|
2023-11-27 18:00:59 -05:00
|
|
|
});
|
|
|
|
});
|