|
| 1 | +import { describe, it, expect } from 'vitest'; |
| 2 | +import { run, REPO, TIMEOUT, SKIP_ONLINE } from './helpers.js'; |
| 3 | + |
| 4 | +describe('settings branches-all', () => { |
| 5 | + it('exits non-zero when --repo is missing', () => { |
| 6 | + const r = run('settings', 'branches-all'); |
| 7 | + expect(r.status).not.toBe(0); |
| 8 | + expect(r.combined).toMatch(/--repo/); |
| 9 | + }); |
| 10 | + |
| 11 | + it.skipIf(SKIP_ONLINE)('returns branch list for repo', () => { |
| 12 | + const r = run('settings', 'branches-all', '--repo', REPO); |
| 13 | + expect(r.status).toBe(0); |
| 14 | + expect(r.combined).toMatch(/branch|name/i); |
| 15 | + }, TIMEOUT); |
| 16 | +}); |
| 17 | + |
| 18 | +describe('settings branches-default', () => { |
| 19 | + it('exits non-zero when --repo is missing', () => { |
| 20 | + const r = run('settings', 'branches-default'); |
| 21 | + expect(r.status).not.toBe(0); |
| 22 | + expect(r.combined).toMatch(/--repo/); |
| 23 | + }); |
| 24 | + |
| 25 | + it.skipIf(SKIP_ONLINE)('returns default branch for repo', () => { |
| 26 | + const r = run('settings', 'branches-default', '--repo', REPO); |
| 27 | + expect(r.status).toBe(0); |
| 28 | + expect(r.combined).toMatch(/branch|default/i); |
| 29 | + }, TIMEOUT); |
| 30 | +}); |
| 31 | + |
| 32 | +describe('settings branches-update-default', () => { |
| 33 | + it('exits non-zero when --repo is missing', () => { |
| 34 | + const r = run('settings', 'branches-update-default', '--branch', 'main'); |
| 35 | + expect(r.status).not.toBe(0); |
| 36 | + expect(r.combined).toMatch(/--repo/); |
| 37 | + }); |
| 38 | + |
| 39 | + it('exits non-zero when --branch is missing', () => { |
| 40 | + const r = run('settings', 'branches-update-default', '--repo', REPO); |
| 41 | + expect(r.status).not.toBe(0); |
| 42 | + expect(r.combined).toMatch(/--branch/); |
| 43 | + }); |
| 44 | +}); |
0 commit comments