@@ -29,55 +29,71 @@ const toLang = `ru`;
2929
3030test . before ( tools . checkCredentials ) ;
3131
32- test ( `should detect language of a single string` , async ( t ) => {
32+ test ( `should detect language of a single string` , async t => {
3333 const output = await tools . runAsync ( `${ cmd } detect "${ text } "` , cwd ) ;
3434 const [ detection ] = await translate . detect ( text ) ;
3535 const expected = `Detections:\n${ text } => ${ detection . language } ` ;
3636 t . is ( output , expected ) ;
3737} ) ;
3838
39- test ( `should detect language of multiple strings` , async ( t ) => {
40- const output = await tools . runAsync ( `${ cmd } detect "${ text } " "${ text2 } "` , cwd ) ;
39+ test ( `should detect language of multiple strings` , async t => {
40+ const output = await tools . runAsync (
41+ `${ cmd } detect "${ text } " "${ text2 } "` ,
42+ cwd
43+ ) ;
4144 const [ detections ] = await translate . detect ( [ text , text2 ] ) ;
42- const expected = `Detections:\n${ text } => ${ detections [ 0 ] . language } \n${ text2 } => ${ detections [ 1 ] . language } ` ;
45+ const expected = `Detections:\n${ text } => ${ detections [ 0 ]
46+ . language } \n${ text2 } => ${ detections [ 1 ] . language } `;
4347 t . is ( output , expected ) ;
4448} ) ;
4549
46- test ( `should list languages` , async ( t ) => {
50+ test ( `should list languages` , async t => {
4751 const output = await tools . runAsync ( `${ cmd } list` , cwd ) ;
4852 t . true ( output . includes ( `Languages:` ) ) ;
4953 t . true ( output . includes ( `{ code: 'af', name: 'Afrikaans' }` ) ) ;
5054} ) ;
5155
52- test ( `should list languages with a target` , async ( t ) => {
56+ test ( `should list languages with a target` , async t => {
5357 const output = await tools . runAsync ( `${ cmd } list es` , cwd ) ;
5458 t . true ( output . includes ( `Languages:` ) ) ;
5559 t . true ( output . includes ( `{ code: 'af', name: 'afrikáans' }` ) ) ;
5660} ) ;
5761
58- test ( `should translate a single string` , async ( t ) => {
59- const output = await tools . runAsync ( `${ cmd } translate ${ toLang } "${ text } "` , cwd ) ;
62+ test ( `should translate a single string` , async t => {
63+ const output = await tools . runAsync (
64+ `${ cmd } translate ${ toLang } "${ text } "` ,
65+ cwd
66+ ) ;
6067 const [ translation ] = await translate . translate ( text , toLang ) ;
6168 const expected = `Translations:\n${ text } => (${ toLang } ) ${ translation } ` ;
6269 t . is ( output , expected ) ;
6370} ) ;
6471
65- test ( `should translate multiple strings` , async ( t ) => {
66- const output = await tools . runAsync ( `${ cmd } translate ${ toLang } "${ text } " "${ text2 } "` , cwd ) ;
72+ test ( `should translate multiple strings` , async t => {
73+ const output = await tools . runAsync (
74+ `${ cmd } translate ${ toLang } "${ text } " "${ text2 } "` ,
75+ cwd
76+ ) ;
6777 const [ translations ] = await translate . translate ( [ text , text2 ] , toLang ) ;
6878 const expected = `Translations:\n${ text } => (${ toLang } ) ${ translations [ 0 ] } \n${ text2 } => (${ toLang } ) ${ translations [ 1 ] } ` ;
6979 t . is ( output , expected ) ;
7080} ) ;
7181
72- test ( `should translate a single string with a model` , async ( t ) => {
73- const output = await tools . runAsync ( `${ cmd } translate-with-model ${ toLang } ${ model } "${ text } "` , cwd ) ;
82+ test ( `should translate a single string with a model` , async t => {
83+ const output = await tools . runAsync (
84+ `${ cmd } translate-with-model ${ toLang } ${ model } "${ text } "` ,
85+ cwd
86+ ) ;
7487 const [ translation ] = await translate . translate ( text , toLang ) ;
7588 const expected = `Translations:\n${ text } => (${ toLang } ) ${ translation } ` ;
7689 t . is ( output , expected ) ;
7790} ) ;
7891
79- test ( `should translate multiple strings with a model` , async ( t ) => {
80- const output = await tools . runAsync ( `${ cmd } translate-with-model ${ toLang } ${ model } "${ text } " "${ text2 } "` , cwd ) ;
92+ test ( `should translate multiple strings with a model` , async t => {
93+ const output = await tools . runAsync (
94+ `${ cmd } translate-with-model ${ toLang } ${ model } "${ text } " "${ text2 } "` ,
95+ cwd
96+ ) ;
8197 const [ translations ] = await translate . translate ( [ text , text2 ] , toLang ) ;
8298 const expected = `Translations:\n${ text } => (${ toLang } ) ${ translations [ 0 ] } \n${ text2 } => (${ toLang } ) ${ translations [ 1 ] } ` ;
8399 t . is ( output , expected ) ;
0 commit comments