Skip to content

Commit 1e9b9fd

Browse files
committed
Using HAsh router on prod, fix spec
1 parent c1b9cee commit 1e9b9fd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cypress/e2e/home.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe('Home Page', () => {
22
beforeEach(() => {
33
const baseUrl = 'http://localhost:5173/ab-test-calculator-link/'
4-
const url = `${baseUrl}?cs=1000&cc=24&vs=1000&vc=54`
4+
const url = `${baseUrl}#/?cs=1000&cc=24&vs=1000&vc=54`
55

66
cy.task("log", `--> Visiting URL: ${url}`)
77

src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3-
import { BrowserRouter } from 'react-router-dom';
3+
import { BrowserRouter, HashRouter } from 'react-router-dom';
44
import App from './App';
55
import './index.css';
66

7-
const Router = BrowserRouter;
7+
const Router = process.env.NODE_ENV === 'production' ? HashRouter : BrowserRouter;
88

99
ReactDOM.createRoot(document.getElementById('root')!).render(
1010
<React.StrictMode>

0 commit comments

Comments
 (0)