Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Feb 15, 2025
1 parent 6bdcbd0 commit f047cf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gax/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const randomUUID = async () =>
globalThis.crypto?.randomUUID() || (await import('crypto')).randomUUID();
const randomUUID = () =>
globalThis.crypto?.randomUUID() || require('crypto').randomUUID();

function words(str: string, normalize = false) {
if (normalize) {
Expand Down
4 changes: 2 additions & 2 deletions gax/test/unit/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('util.ts', () => {
);
});

it('returns UUID', async () => {
assert.match(await makeUUID(), /[a-z0-9-]{36}/);
it('returns UUID', () => {
assert.match(makeUUID(), /[a-z0-9-]{36}/);
});
});

0 comments on commit f047cf8

Please sign in to comment.