[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

test(browser): unskipped https test for browser (#5290)

authored by

Michael サイトー 中村 Bashurov and committed by
GitHub
(Feb 26, 2024, 12:07 PM +0900) de8cf2d5 5bb8b380

+14 -4
+3 -4
test/browser/specs/server-url.test.mjs
··· 13 13 assert.match(result.stdout, /Test Files {2}1 passed/) 14 14 }) 15 15 16 - // this test is skipped since browser warns self-signed https and it requires manual interaction. 17 - // you can toggle "skip" to verify it locally. 18 - test('server-url https', { skip: true }, async () => { 19 - const result = await execa('npx', ['vitest', 'run', '--root=./fixtures/server-url'], { 16 + test('server-url https', async () => { 17 + const result = await execa('npx', ['vitest', 'run', '--root=./fixtures/server-url', '--browser.headless'], { 20 18 env: { 19 + CI: '1', 21 20 NO_COLOR: '1', 22 21 TEST_HTTPS: '1', 23 22 },
+11
test/browser/fixtures/server-url/vitest.config.ts
··· 9 9 const provider = process.env.PROVIDER || 'webdriverio'; 10 10 const browser = process.env.BROWSER || (provider === 'playwright' ? 'chromium' : 'chrome'); 11 11 12 + // ignore https errors due to self-signed certificate from plugin-basic-ssl 13 + // https://playwright.dev/docs/api/class-browser#browser-new-context-option-ignore-https-errors 14 + // https://webdriver.io/docs/configuration/#strictssl and acceptInsecureCerts in https://webdriver.io/docs/api/browser/#properties 15 + const providerOptions = (function () { 16 + switch (provider) { 17 + case 'playwright': return { page: { ignoreHTTPSErrors: true } } 18 + case 'webdriverio': return { strictSSL: false, capabilities: { acceptInsecureCerts: true } } 19 + } 20 + })() 21 + 12 22 export default defineConfig({ 13 23 plugins: [ 14 24 !!process.env.TEST_HTTPS && basicSsl(), ··· 18 28 enabled: true, 19 29 provider, 20 30 name: browser, 31 + providerOptions, 21 32 }, 22 33 }, 23 34 // separate cacheDir from test/browser/vite.config.ts