diff --git a/translate/.eslintrc.yml b/translate/.eslintrc.yml index 7e847a0e1eb..282535f55f6 100644 --- a/translate/.eslintrc.yml +++ b/translate/.eslintrc.yml @@ -1,4 +1,3 @@ --- rules: no-console: off - no-warning-comments: off diff --git a/translate/test/.eslintrc.yml b/translate/test/.eslintrc.yml deleted file mode 100644 index 6db2a46c535..00000000000 --- a/translate/test/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -env: - mocha: true diff --git a/translate/test/automlTranslation.test.js b/translate/test/automlTranslation.test.js index 18dcb981b32..f73ee85cf10 100644 --- a/translate/test/automlTranslation.test.js +++ b/translate/test/automlTranslation.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); diff --git a/translate/test/hybridGlossaries.test.js b/translate/test/hybridGlossaries.test.js index d2c5a554d8b..02633336de8 100644 --- a/translate/test/hybridGlossaries.test.js +++ b/translate/test/hybridGlossaries.test.js @@ -16,6 +16,7 @@ const fs = require('fs'); const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); @@ -29,7 +30,7 @@ describe(REGION_TAG, () => { const glossaryId = 'bistro-glossary'; const outputFile = 'resources/example.mp3'; - before(async function() { + before(() => { try { fs.unlinkSync(outputFile); } catch (e) { diff --git a/translate/test/quickstart.test.js b/translate/test/quickstart.test.js index fec6f136e7b..b9e9ea11b9e 100644 --- a/translate/test/quickstart.test.js +++ b/translate/test/quickstart.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const cp = require('child_process'); const path = require('path'); diff --git a/translate/test/translate.test.js b/translate/test/translate.test.js index f237425473c..02307c583ee 100644 --- a/translate/test/translate.test.js +++ b/translate/test/translate.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {Translate} = require('@google-cloud/translate').v2; const cp = require('child_process'); diff --git a/translate/test/v3/translate_batch_translate_text.test.js b/translate/test/v3/translate_batch_translate_text.test.js index b9633337e97..ce831df621a 100644 --- a/translate/test/v3/translate_batch_translate_text.test.js +++ b/translate/test/v3/translate_batch_translate_text.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const {Storage} = require('@google-cloud/storage'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_batch_translate_text_with_glossary.test.js b/translate/test/v3/translate_batch_translate_text_with_glossary.test.js index e8a67f4a43d..e79458c65cd 100644 --- a/translate/test/v3/translate_batch_translate_text_with_glossary.test.js +++ b/translate/test/v3/translate_batch_translate_text_with_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const {Storage} = require('@google-cloud/storage'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js b/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js index 6e67a9d67a1..74ecfcad26a 100644 --- a/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js +++ b/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const {Storage} = require('@google-cloud/storage'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_batch_translate_text_with_model.test.js b/translate/test/v3/translate_batch_translate_text_with_model.test.js index a668bb051b9..91344deda06 100644 --- a/translate/test/v3/translate_batch_translate_text_with_model.test.js +++ b/translate/test/v3/translate_batch_translate_text_with_model.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const {Storage} = require('@google-cloud/storage'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_create_glossary.test.js b/translate/test/v3/translate_create_glossary.test.js index a5f973b6fe1..4c69b4b14c5 100644 --- a/translate/test/v3/translate_create_glossary.test.js +++ b/translate/test/v3/translate_create_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); const uuid = require('uuid'); diff --git a/translate/test/v3/translate_delete_glossary.test.js b/translate/test/v3/translate_delete_glossary.test.js index f516a907403..dbb6551a15c 100644 --- a/translate/test/v3/translate_delete_glossary.test.js +++ b/translate/test/v3/translate_delete_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); const uuid = require('uuid'); diff --git a/translate/test/v3/translate_detect_language.test.js b/translate/test/v3/translate_detect_language.test.js index 3ebf4be02a4..eabf826882d 100644 --- a/translate/test/v3/translate_detect_language.test.js +++ b/translate/test/v3/translate_detect_language.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_get_glossary.test.js b/translate/test/v3/translate_get_glossary.test.js index 47550b9c4b4..0fac5016654 100644 --- a/translate/test/v3/translate_get_glossary.test.js +++ b/translate/test/v3/translate_get_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); const uuid = require('uuid'); diff --git a/translate/test/v3/translate_get_supported_languages.test.js b/translate/test/v3/translate_get_supported_languages.test.js index 990ffbec8bc..010e794fd86 100644 --- a/translate/test/v3/translate_get_supported_languages.test.js +++ b/translate/test/v3/translate_get_supported_languages.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_get_supported_languages_for_targets.test.js b/translate/test/v3/translate_get_supported_languages_for_targets.test.js index c16b54139de..de3c5b62ad9 100644 --- a/translate/test/v3/translate_get_supported_languages_for_targets.test.js +++ b/translate/test/v3/translate_get_supported_languages_for_targets.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_list_codes.test.js b/translate/test/v3/translate_list_codes.test.js index 725a86fd595..78ed075cfa1 100644 --- a/translate/test/v3/translate_list_codes.test.js +++ b/translate/test/v3/translate_list_codes.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_list_glossary.test.js b/translate/test/v3/translate_list_glossary.test.js index 627688dbb33..3ca68a2ba7d 100644 --- a/translate/test/v3/translate_list_glossary.test.js +++ b/translate/test/v3/translate_list_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const uuid = require('uuid'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_list_language_names.test.js b/translate/test/v3/translate_list_language_names.test.js index e8343fff4f2..044a1af035d 100644 --- a/translate/test/v3/translate_list_language_names.test.js +++ b/translate/test/v3/translate_list_language_names.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_translate_text.test.js b/translate/test/v3/translate_translate_text.test.js index efc11b4582d..4393c085f89 100644 --- a/translate/test/v3/translate_translate_text.test.js +++ b/translate/test/v3/translate_translate_text.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); @@ -31,6 +32,6 @@ describe(REGION_TAG, () => { const output = execSync( `node v3/${REGION_TAG}.js ${projectId} ${location} ${text}` ); - assert.match(output, /Translation: Pozdrav svijetu/); + assert.match(output, /Translation: Zdravo svijete/); }); }); diff --git a/translate/test/v3/translate_translate_text_with_glossary.test.js b/translate/test/v3/translate_translate_text_with_glossary.test.js index 1bbb797c719..97cc5f783c6 100644 --- a/translate/test/v3/translate_translate_text_with_glossary.test.js +++ b/translate/test/v3/translate_translate_text_with_glossary.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const uuid = require('uuid'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js b/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js index 372984699cc..15d4615b419 100644 --- a/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js +++ b/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const uuid = require('uuid'); const cp = require('child_process'); diff --git a/translate/test/v3/translate_translate_text_with_model.test.js b/translate/test/v3/translate_translate_text_with_model.test.js index 938d0398714..bfc7385525b 100644 --- a/translate/test/v3/translate_translate_text_with_model.test.js +++ b/translate/test/v3/translate_translate_text_with_model.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate'); const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_batch_translate_text_beta.test.js b/translate/test/v3beta1/translate_batch_translate_text_beta.test.js index b63b46d3fd8..7a5ecef7d31 100644 --- a/translate/test/v3beta1/translate_batch_translate_text_beta.test.js +++ b/translate/test/v3beta1/translate_batch_translate_text_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const {Storage} = require('@google-cloud/storage'); const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_create_glossary_beta.test.js b/translate/test/v3beta1/translate_create_glossary_beta.test.js index 8d427d751eb..4ff2dcb2ecb 100644 --- a/translate/test/v3beta1/translate_create_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_create_glossary_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_delete_glossary_beta.test.js b/translate/test/v3beta1/translate_delete_glossary_beta.test.js index aaa04900cd0..0653fc83ea0 100644 --- a/translate/test/v3beta1/translate_delete_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_delete_glossary_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_detect_language_beta.test.js b/translate/test/v3beta1/translate_detect_language_beta.test.js index 0d7520cf195..7a6715d253f 100644 --- a/translate/test/v3beta1/translate_detect_language_beta.test.js +++ b/translate/test/v3beta1/translate_detect_language_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_get_glossary_beta.test.js b/translate/test/v3beta1/translate_get_glossary_beta.test.js index 5f36124016d..590e974eaf0 100644 --- a/translate/test/v3beta1/translate_get_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_get_glossary_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_list_codes_beta.test.js b/translate/test/v3beta1/translate_list_codes_beta.test.js index 05c02823e1b..ad345151d4c 100644 --- a/translate/test/v3beta1/translate_list_codes_beta.test.js +++ b/translate/test/v3beta1/translate_list_codes_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_list_glossary_beta.test.js b/translate/test/v3beta1/translate_list_glossary_beta.test.js index 6d3210302e6..bbcdc409fcf 100644 --- a/translate/test/v3beta1/translate_list_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_list_glossary_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_list_language_names_beta.test.js b/translate/test/v3beta1/translate_list_language_names_beta.test.js index 61d8b3c8280..7d588fede8c 100644 --- a/translate/test/v3beta1/translate_list_language_names_beta.test.js +++ b/translate/test/v3beta1/translate_list_language_names_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_translate_text_beta.test.js b/translate/test/v3beta1/translate_translate_text_beta.test.js index 6e8652856ee..a6bde08890d 100644 --- a/translate/test/v3beta1/translate_translate_text_beta.test.js +++ b/translate/test/v3beta1/translate_translate_text_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); @@ -31,6 +32,6 @@ describe(REGION_TAG, () => { const output = execSync( `node v3beta1/${REGION_TAG}.js ${projectId} ${location} ${text}` ); - assert.match(output, /Translation: Pozdrav svijetu/); + assert.match(output, /Translation: Zdravo svijete/); }); }); diff --git a/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js b/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js index 23862fff23a..a9992c62fb0 100644 --- a/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js +++ b/translate/test/v3beta1/translate_translate_text_with_glossary_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process'); diff --git a/translate/test/v3beta1/translate_translate_text_with_model_beta.test.js b/translate/test/v3beta1/translate_translate_text_with_model_beta.test.js index 8c7c9f12f7b..af55ae6bf65 100644 --- a/translate/test/v3beta1/translate_translate_text_with_model_beta.test.js +++ b/translate/test/v3beta1/translate_translate_text_with_model_beta.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {describe, it} = require('mocha'); const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1; const cp = require('child_process');