Skip to content

Commit

Permalink
chore: use top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Oct 19, 2024
1 parent cafb99e commit 3ab65cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions test/browser-mock.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
5 changes: 1 addition & 4 deletions test/react-native.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 3ab65cd

Please sign in to comment.