0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/packages/upgrade/test/context.test.js
Bjorn Lu 849e4c6c23
Use node parseArgs instead of yargs-parser and arg (#11645)
* wip

* done

* Add changeset

* Format

* Update

* Fix houston

* Fix test

* Fix test
2024-08-14 11:05:50 +01:00

20 lines
576 B
JavaScript

import * as assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { getContext } from '../dist/index.js';
describe('context', () => {
it('no arguments', async () => {
const ctx = await getContext([]);
assert.equal(ctx.version, 'latest');
assert.equal(ctx.dryRun, false);
});
it('tag', async () => {
const ctx = await getContext(['beta']);
assert.equal(ctx.version, 'beta');
assert.equal(ctx.dryRun, false);
});
it('dry run', async () => {
const ctx = await getContext(['--dry-run']);
assert.equal(ctx.dryRun, true);
});
});