mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 13:29:13 -04:00
fix: refactor with unit test + better handle korean
This commit is contained in:
parent
c434a5f3f0
commit
7a4310ad90
8 changed files with 1857 additions and 1589 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue