tests for weather class
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m18s
Unit tests / Unit tests (push) Successful in -2m12s

This commit is contained in:
2025-08-24 21:29:11 -05:00
parent b51d014c80
commit 9668cd80b4
6 changed files with 1171 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
import { assert, describe, expect, it } from 'vitest'
import path from 'path';
import { describe, expect, it } from 'vitest';
import { voiceLines, LINES } from '../src/voice.js';
import type { Voice } from '../src/voice.js';
@@ -113,4 +114,16 @@ describe('voiceLines', () => {
expect(voiceLines(dummyVoice, NaN)).length.to.be.empty;
expect(voiceLines(dummyVoice, 1e21)).length.to.be.empty;
});
it('returns the results as paths when voice configuration is provided', () => {
const directory = path.join('audio', 'voice', 'someone');
const v: Voice = {
directory,
extension: 'flac'
}
expect(voiceLines(v, 29)).to.include.ordered.members([
path.join(directory, `twenty.flac`),
path.join(directory, `nine.flac`),
]);
});
});