Daily Bluesky bot for AT Mot. Invites players and congratulates yesterday's solvers.
1import { describe, it, expect } from 'vitest';
2import { langForCron } from '../src/index.js';
3
4describe('langForCron', () => {
5 it('maps the configured EN and FR crons', () => {
6 expect(langForCron('10 0 * * *')).toBe('en');
7 expect(langForCron('11 0 * * *')).toBe('fr');
8 });
9
10 it('throws on an unrecognized cron rather than defaulting to EN', () => {
11 expect(() => langForCron('11 1 * * *')).toThrow(/unmapped cron/);
12 expect(() => langForCron('')).toThrow(/unmapped cron/);
13 expect(() => langForCron('* * * * *')).toThrow(/unmapped cron/);
14 });
15});