fix: refactor with unit test + better handle korean

This commit is contained in:
ShareVB 2024-05-15 22:08:06 +02:00
parent c434a5f3f0
commit 7a4310ad90
8 changed files with 1857 additions and 1589 deletions

View file

@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest';
import { textToNatoAlphabet } from './text-to-nato-alphabet.service';
import natoTests from './nato.test.data.json';
describe('text-to-nato', () => {
it('Convert text to NATO', async () => {
for (const nato of natoTests) {
const { lang, input, output } = nato;
expect(textToNatoAlphabet({ text: input, langOrCountry: lang })).to.equal(output);
}
});
});