intro.test.js 700 B

1234567891011121314151617181920
  1. import assert from 'node:assert/strict';
  2. import { describe, it } from 'node:test';
  3. import { intro } from '../dist/index.js';
  4. import { setup } from './utils.js';
  5. describe('intro', () => {
  6. const fixture = setup();
  7. it('no arguments', async () => {
  8. await intro({ skipHouston: false, version: '0.0.0', username: 'user' });
  9. assert.ok(fixture.hasMessage('Houston:'));
  10. assert.ok(fixture.hasMessage('Welcome to astro v0.0.0'));
  11. });
  12. it('--skip-houston', async () => {
  13. await intro({ skipHouston: true, version: '0.0.0', username: 'user' });
  14. assert.equal(fixture.length(), 1);
  15. assert.ok(!fixture.hasMessage('Houston:'));
  16. assert.ok(fixture.hasMessage('Launch sequence initiated'));
  17. });
  18. });