Skip to content

Commit

Permalink
refactor: use explicit mocha imports (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and bcoe committed Dec 30, 2019
1 parent 8bc6450 commit ee56d2c
Show file tree
Hide file tree
Showing 34 changed files with 35 additions and 7 deletions.
1 change: 0 additions & 1 deletion translate/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
rules:
no-console: off
no-warning-comments: off
3 changes: 0 additions & 3 deletions translate/test/.eslintrc.yml

This file was deleted.

1 change: 1 addition & 0 deletions translate/test/automlTranslation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
Expand Down
3 changes: 2 additions & 1 deletion translate/test/hybridGlossaries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions translate/test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'use strict';

const {assert} = require('chai');
const {describe, it} = require('mocha');
const cp = require('child_process');
const path = require('path');

Expand Down
1 change: 1 addition & 0 deletions translate/test/translate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_batch_translate_text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_create_glossary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_delete_glossary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_detect_language.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_get_glossary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_list_codes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_list_glossary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions translate/test/v3/translate_list_language_names.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
3 changes: 2 additions & 1 deletion translate/test/v3/translate_translate_text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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/);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3beta1/translate_get_glossary_beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions translate/test/v3beta1/translate_list_codes_beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
3 changes: 2 additions & 1 deletion translate/test/v3beta1/translate_translate_text_beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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/);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit ee56d2c

Please sign in to comment.