Skip to content

Commit

Permalink
feat(ct): https
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Dec 25, 2022
1 parent cce2921 commit afbd36e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/playwright-test/src/plugins/vitePlugin.ts
Expand Up @@ -94,7 +94,7 @@ export function createPlugin(
const sourcesDirty = !buildExists || hasNewComponents || await checkSources(buildInfo);

viteConfig.root = rootDir;
viteConfig.preview = { port };
viteConfig.preview = { port, ...viteConfig.preview };
viteConfig.build = {
outDir
};
Expand Down Expand Up @@ -152,9 +152,10 @@ export function createPlugin(
stoppableServer = stoppable(previewServer.httpServer, 0);
const isAddressInfo = (x: any): x is AddressInfo => x?.address;
const address = previewServer.httpServer.address();
if (isAddressInfo(address))
process.env.PLAYWRIGHT_TEST_BASE_URL = `http://localhost:${address.port}`;

if (isAddressInfo(address)) {
const protocol = viteConfig.preview.https ? 'https:' : 'http:';
process.env.PLAYWRIGHT_TEST_BASE_URL = `${protocol}//localhost:${address.port}`;
}
},

teardown: async () => {
Expand Down
1 change: 0 additions & 1 deletion tests/components/ct-solid/vite.config.ts
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';

export default defineConfig({
plugins: [solidPlugin()],
server: {
Expand Down

0 comments on commit afbd36e

Please sign in to comment.