Skip to content

Commit

Permalink
test: replace 'after' hook with 'afterEach' to ensure directory delet…
Browse files Browse the repository at this point in the history
…ion (#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
  • Loading branch information
aribray authored and Ace Nassri committed Nov 17, 2022
1 parent 3325acb commit a1faad9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const {assert} = require('chai');
const {describe, it, before, after} = require('mocha');
const {describe, it, before, afterEach} = require('mocha');
const {TranslationServiceClient} = require('@google-cloud/translate');
const {Storage} = require('@google-cloud/storage');
const cp = require('child_process');
Expand Down Expand Up @@ -80,7 +80,7 @@ describe(REGION_TAG, () => {
});

// Delete the folder from GCS for cleanup
after(async () => {
afterEach(async () => {
const projectId = await translationClient.getProjectId();
const options = {
prefix: `translation-${bucketUuid}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const {assert} = require('chai');
const {describe, it, before, after} = require('mocha');
const {describe, it, before, afterEach} = require('mocha');
const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1;
const {Storage} = require('@google-cloud/storage');
const cp = require('child_process');
Expand Down Expand Up @@ -65,7 +65,7 @@ describe(REGION_TAG, () => {
});

// Delete the folder from GCS for cleanup
after(async () => {
afterEach(async () => {
const projectId = await translationClient.getProjectId();
const options = {
prefix: `translation-${bucketUuid}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const {assert} = require('chai');
const {describe, it, before, after} = require('mocha');
const {describe, it, before, afterEach} = require('mocha');
const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1;
const {Storage} = require('@google-cloud/storage');
const cp = require('child_process');
Expand Down Expand Up @@ -66,7 +66,7 @@ describe(REGION_TAG, () => {
});

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

0 comments on commit a1faad9

Please sign in to comment.