inital commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { createKeyRotator, parseKeys } from '../src/key-store.js';
|
||||
|
||||
describe('key store', () => {
|
||||
it('parses keys, blank lines, and comments', () => {
|
||||
expect(parseKeys(' first \n\nsecond # note\n# ignored\n')).toEqual(['first', 'second']);
|
||||
});
|
||||
|
||||
it('rotates keys round-robin', () => {
|
||||
const rotator = createKeyRotator(['a', 'b']);
|
||||
expect([rotator.next(), rotator.next(), rotator.next()]).toEqual(['a', 'b', 'a']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user