expectGuest function

void expectGuest()

Assert that no user is authenticated (guest).

Implementation

void expectGuest() {
  try {
    final user = Nylo.user();
    expect(user, isNull, reason: 'Expected no authenticated user (guest)');
  } catch (_) {
    // Auth key not set, which also means guest
  }
}