context.test.js 584 B

1234567891011121314151617181920
  1. import { describe, it } from 'node:test';
  2. import * as assert from 'node:assert/strict';
  3. import { getContext } from '../dist/index.js';
  4. describe('context', () => {
  5. it('no arguments', async () => {
  6. const ctx = await getContext([]);
  7. assert.equal(ctx.version, 'latest');
  8. assert.equal(ctx.dryRun, undefined);
  9. });
  10. it('tag', async () => {
  11. const ctx = await getContext(['beta']);
  12. assert.equal(ctx.version, 'beta');
  13. assert.equal(ctx.dryRun, undefined);
  14. });
  15. it('dry run', async () => {
  16. const ctx = await getContext(['--dry-run']);
  17. assert.equal(ctx.dryRun, true);
  18. });
  19. });