Skip to content
Permalink
Browse files
refactor: optimize async and await in code (#9854)
  • Loading branch information
dev-itsheng committed Sep 6, 2022
1 parent 9c1be10 commit 31f5ff3ef9ee071afa8cc66870e13e9753c3ab93
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
@@ -232,7 +232,7 @@ async function createDepsOptimizer(
}
}

async function startNextDiscoveredBatch() {
function startNextDiscoveredBatch() {
newDepsDiscovered = false

// Add the current depOptimizationProcessing to the queue, these
@@ -87,7 +87,7 @@ function markExplicitImport(url: string) {
return url
}

async function extractImportedBindings(
function extractImportedBindings(
id: string,
source: string,
importSpec: ImportSpecifier,
@@ -272,7 +272,7 @@ describe.runIf(isBuild)('encodeURI', () => {
test('img src with encodeURI', async () => {
const img = await page.$('.encodeURI')
expect(
await (await img.getAttribute('src')).startsWith('data:image/png;base64')
(await img.getAttribute('src')).startsWith('data:image/png;base64')
).toBe(true)
})
})
@@ -6,7 +6,7 @@ export async function render(url, manifest) {
const { app, router } = createApp()

// set the router to the desired URL before rendering
router.push(url)
await router.push(url)
await router.isReady()

// passing SSR context object which will be available via useSSRContext()
@@ -42,7 +42,7 @@ export async function setup(): Promise<void> {
}

export async function teardown(): Promise<void> {
browserServer?.close()
await browserServer?.close()
if (!process.env.VITE_PRESERVE_BUILD_ARTIFACTS) {
fs.removeSync(path.resolve(__dirname, '../playground-temp'))
}
@@ -172,7 +172,7 @@ beforeAll(async (s) => {
serverLogs.length = 0
await page?.close()
await server?.close()
watcher?.close()
await watcher?.close()
if (browser) {
await browser.close()
}

0 comments on commit 31f5ff3

Please sign in to comment.