Skip to content

Commit a1faad9

Browse files
aribrayAce Nassri
authored and
Ace Nassri
committed
test: replace 'after' hook with 'afterEach' to ensure directory deletion (#737)
* fix: replace 'after' hook with 'afterEach' to delete bucket before each retry Change-Id: Ia9323762e3c68916217fc734df1df485c9b0e83c * fix: replace 'after' hook with 'afterEach' for translate text beta and translate text with model Change-Id: Ic32bea9ea1ef93e622f76b5d45bae2a62f577532
1 parent 3325acb commit a1faad9

3 files changed

+6
-6
lines changed

translate/test/v3/translate_batch_translate_text_with_model.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, before, after} = require('mocha');
18+
const {describe, it, before, afterEach} = require('mocha');
1919
const {TranslationServiceClient} = require('@google-cloud/translate');
2020
const {Storage} = require('@google-cloud/storage');
2121
const cp = require('child_process');
@@ -80,7 +80,7 @@ describe(REGION_TAG, () => {
8080
});
8181

8282
// Delete the folder from GCS for cleanup
83-
after(async () => {
83+
afterEach(async () => {
8484
const projectId = await translationClient.getProjectId();
8585
const options = {
8686
prefix: `translation-${bucketUuid}`,

translate/test/v3beta1/translate_batch_translate_document.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, before, after} = require('mocha');
18+
const {describe, it, before, afterEach} = require('mocha');
1919
const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1;
2020
const {Storage} = require('@google-cloud/storage');
2121
const cp = require('child_process');
@@ -65,7 +65,7 @@ describe(REGION_TAG, () => {
6565
});
6666

6767
// Delete the folder from GCS for cleanup
68-
after(async () => {
68+
afterEach(async () => {
6969
const projectId = await translationClient.getProjectId();
7070
const options = {
7171
prefix: `translation-${bucketUuid}`,

translate/test/v3beta1/translate_batch_translate_text_beta.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, before, after} = require('mocha');
18+
const {describe, it, before, afterEach} = require('mocha');
1919
const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1;
2020
const {Storage} = require('@google-cloud/storage');
2121
const cp = require('child_process');
@@ -66,7 +66,7 @@ describe(REGION_TAG, () => {
6666
});
6767

6868
// Delete the folder from GCS for cleanup
69-
after(async () => {
69+
afterEach(async () => {
7070
const projectId = await translationClient.getProjectId();
7171
const options = {
7272
prefix: `translation-${bucketUuid}`,

0 commit comments

Comments
 (0)