wizard.test.ts13 lines · main
| 1 | import { test } from 'node:test'; |
| 2 | import { strict as assert } from 'node:assert'; |
| 3 | import { decideBranch } from './wizard.js'; |
| 4 | |
| 5 | test('decideBranch: missing briven.json → wizard', () => { |
| 6 | assert.equal(decideBranch({ hasBrivenJson: false, hasUserToken: true }), 'wizard'); |
| 7 | }); |
| 8 | test('decideBranch: missing token → auth then watch', () => { |
| 9 | assert.equal(decideBranch({ hasBrivenJson: true, hasUserToken: false }), 'auth-then-watch'); |
| 10 | }); |
| 11 | test('decideBranch: both present → watch', () => { |
| 12 | assert.equal(decideBranch({ hasBrivenJson: true, hasUserToken: true }), 'watch'); |
| 13 | }); |