From 87d5267b3e0dc3092d51a3ee8e6d14a9d6adc928 Mon Sep 17 00:00:00 2001 From: Blake Byrnes Date: Thu, 13 Jun 2024 12:53:12 -0400 Subject: [PATCH] chore: fix test for headless=new --- .github/workflows/lint-and-test.yml | 2 +- .github/workflows/release-test.yml | 2 +- core/lib/FrameEnvironment.ts | 2 ++ core/lib/Tab.ts | 4 +++- core/lib/UserProfile.ts | 2 +- core/test/events.test.ts | 4 +++- core/test/resources.test.ts | 8 ++++++-- core/test/user-profile.test.ts | 10 +++++----- end-to-end/test/basic.test.ts | 2 ++ 9 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 5615f2a59..2c4931c8b 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -24,7 +24,7 @@ jobs: include: - node-version: 18.x os: ubuntu-latest - browser: chrome-97-0 + browser: chrome-114-0 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 6a257914a..128703f78 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -22,7 +22,7 @@ jobs: include: - node-version: 18.x os: ubuntu-latest - browser: chrome-97-0 + browser: chrome-114-0 runs-on: ${{ matrix.os }} diff --git a/core/lib/FrameEnvironment.ts b/core/lib/FrameEnvironment.ts index b672d5225..f1ef9fa06 100644 --- a/core/lib/FrameEnvironment.ts +++ b/core/lib/FrameEnvironment.ts @@ -400,6 +400,7 @@ b) Use the UserProfile feature to set cookies for 1 or more domains before they' domain: cookie.domain, }, ]); + await new Promise(setImmediate); return true; } } @@ -411,6 +412,7 @@ b) Use the UserProfile feature to set cookies for 1 or more domains before they' url: this.frame.url, }, ]); + await new Promise(setImmediate); return true; } diff --git a/core/lib/Tab.ts b/core/lib/Tab.ts index 64d2e42ee..930b43bd8 100644 --- a/core/lib/Tab.ts +++ b/core/lib/Tab.ts @@ -359,7 +359,9 @@ export default class Tab mitmSession.interceptorHandlers.unshift({ urls: [origin], handlerFn(url, type, request, response) { - response.end(`Empty`); + response.end( + `Empty`, + ); return true; }, }); diff --git a/core/lib/UserProfile.ts b/core/lib/UserProfile.ts index f26f446bc..9ae50b856 100644 --- a/core/lib/UserProfile.ts +++ b/core/lib/UserProfile.ts @@ -148,7 +148,7 @@ for (const [key,value] of ${JSON.stringify(localStorage)}) { responseCode: 200, requestId, body: Buffer.from( - ` + `
Loading UserProfile for ${url.origin}