-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(browser): init browsers eagerly when tests are running (#6876)
- Loading branch information
1 parent
32be0af
commit 417bdb4
Showing
13 changed files
with
83 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import { afterEach, expect, test } from 'vitest' | ||
import { provider, runBrowserTests } from './utils' | ||
import { runBrowserTests } from './utils' | ||
|
||
afterEach(() => { | ||
delete process.env.TEST_HTTPS | ||
}) | ||
|
||
test('server-url http', async () => { | ||
const { stdout, stderr } = await runBrowserTests({ | ||
const { stderr, ctx } = await runBrowserTests({ | ||
root: './fixtures/server-url', | ||
watch: true, // otherwise the browser is closed before we can get the url | ||
}) | ||
const url = ctx?.projects[0].browser?.vite.resolvedUrls?.local[0] | ||
expect(stderr).toBe('') | ||
expect(stdout).toContain(`Browser runner started by ${provider} at http://localhost:51133/`) | ||
expect(url).toBe('http://localhost:51133/') | ||
}) | ||
|
||
test('server-url https', async () => { | ||
process.env.TEST_HTTPS = '1' | ||
const { stdout, stderr } = await runBrowserTests({ | ||
const { stdout, stderr, ctx } = await runBrowserTests({ | ||
root: './fixtures/server-url', | ||
watch: true, // otherwise the browser is closed before we can get the url | ||
}) | ||
expect(stderr).toBe('') | ||
expect(stdout).toContain(`Browser runner started by ${provider} at https://localhost:51122/`) | ||
const url = ctx?.projects[0].browser?.vite.resolvedUrls?.local[0] | ||
expect(url).toBe('https://localhost:51122/') | ||
expect(stdout).toContain('Test Files 1 passed') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { test } from 'vitest'; | ||
|
||
test('passes') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters