Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ test.beforeEach(() => {

test('translate without any options', async t => {
const res = await translate('vertaler');

Comment thread
rawr51919 marked this conversation as resolved.
t.is(res.text, 'translator');
t.false(res.from.language.didYouMean);
t.is(res.from.language.iso, 'nl');
Expand All @@ -22,7 +21,6 @@ test('translate without any options', async t => {

test('translate from auto to dutch', async t => {
const res = await translate('translator', {from: 'auto', to: 'nl'});

t.is(res.text, 'vertaler');
t.false(res.from.language.didYouMean);
t.is(res.from.language.iso, 'en');
Expand All @@ -33,23 +31,19 @@ test('translate from auto to dutch', async t => {

test('translate some english text setting the source language as portuguese', async t => {
const res = await translate('translator', {from: 'pt', to: 'nl'});

t.true(res.from.language.didYouMean);
t.is(res.from.language.iso, 'en');
});

test('translate some misspelled english text to dutch', async t => {
const res = await translate('I spea Dutch', {from: 'en', to: 'nl'});

if (res.from.text.autoCorrected || res.from.text.didYouMean) {
t.is(res.from.text.value, 'I [speak] Dutch');
} else {
t.fail();
}
});

test.todo('try to translate some text without an internet connection');

test('translate some text and get the raw output alongside', async t => {
const res = await translate('vertaler', {raw: true});
t.truthy(res.raw);
Expand Down Expand Up @@ -127,7 +121,6 @@ test('translate from dutch to english using language names instead of codes', as

test('translate via custom tld', async t => {
const res = await translate('vertaler', {tld: 'cn'});

t.is(res.text, 'translator');
t.false(res.from.language.didYouMean);
t.is(res.from.language.iso, 'nl');
Expand Down