From 3ab65cd67a3b8e9f9531a7d3688dda808e0b77df Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 20 Apr 2022 13:52:35 -0700 Subject: [PATCH] chore: use top-level await --- test/browser-mock.test.js | 5 +---- test/react-native.test.js | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/test/browser-mock.test.js b/test/browser-mock.test.js index f03d8ae..7608969 100644 --- a/test/browser-mock.test.js +++ b/test/browser-mock.test.js @@ -2,10 +2,7 @@ // Only run in Node.js. if (typeof window === 'undefined') { - let assert - (async function () { - assert = (await import('node:assert')).default - })() + const assert = (await import('node:assert')).default describe('Browser-like environment', function () { before(function () { diff --git a/test/react-native.test.js b/test/react-native.test.js index a522552..2e8e3e4 100644 --- a/test/react-native.test.js +++ b/test/react-native.test.js @@ -2,10 +2,7 @@ // Only run in Node.js. if (typeof window === 'undefined') { - let assert - (async function () { - assert = (await import('node:assert')).default - })() + const assert = (await import('node:assert')).default describe('React Native-like environment', function () { before(function () {