Skip to content

Commit

Permalink
test(e2e): fix execution
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jan 21, 2025
1 parent 61fb3ae commit 8d9a28a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
MAP_REGION: ${{ vars.MAP_REGION }}
MAP_NAME: ${{ vars.MAP_NAME }}
MAP_API_KEY: ${{ vars.MAP_API_KEY }}
REGISTRY_ENDPOINT: http://localhost:8080/e2e/registry.json
run: npm run test:e2e

# This generates a string containing the current date which is used in
Expand Down
10 changes: 6 additions & 4 deletions e2e-tests/vite.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ import { createContext } from './lib/mock-backend/context.js'
import { mockWebsocket } from './lib/mock-backend/mockWebsocket.js'
import { testdataServerPlugin } from './lib/testDataServerPlugin.js'

const { mapRegion, mapName, mapApiKey } = fromEnv({
const { mapRegion, mapName, mapApiKey, registryEndpoint } = fromEnv({
mapRegion: 'MAP_REGION',
mapName: 'MAP_NAME',
mapApiKey: 'MAP_API_KEY',
registryEndpoint: 'REGISTRY_ENDPOINT',
})(process.env)

const context = createContext(join(process.cwd(), 'db'))

const base = 'http://localhost:8080'
const domainName = 'localhost:8080'
const base = `http://${domainName}`

const wsPort = 1024 + Math.floor(Math.random() * (65535 - 1024))
mockWebsocket(wsPort, context)

export default createConfig({
domainName: 'localhost:8080',
registryEndpoint: new URL('/e2e/registry.json', base),
domainName,
registryEndpoint: new URL(registryEndpoint),
plugins: [
testdataServerPlugin({
registry: {
Expand Down

0 comments on commit 8d9a28a

Please sign in to comment.