Skip to content

Conversation

mority
Copy link
Contributor

@mority mority commented Mar 17, 2025

#228 adds simulation time

playwright test cases currently not working:

mority@topcut:~/code/prima$ npx playwright test e2e/booking.test.ts
Error: Cannot find package '$env' imported from /home/mority/code/prima/src/lib/util/time.ts
Error: Cannot find package '$env' imported from /home/mority/code/prima/src/lib/util/time.ts
Error: Cannot find package '$env' imported from /home/mority/code/prima/src/lib/util/time.ts
Error: No tests found.
Make sure that arguments are regular expressions matching test files.
You may need to escape symbols like "$" or "*" and quote the arguments.

@mority
Copy link
Contributor Author

mority commented Mar 17, 2025

Switched to environment variables from process.env

We now need a way to communicate the simulation time set on the server side to the client. May be this can be done using Svelte's render?

return second * SECOND;
}

export function nowOrSimulationTime() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this function be in the lib/server folder? It can't be used on the client

In case this function is only used in SvelteKit, it could also use $env - if it's used in Playwright too then not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be in lib/server then since it is indeed only used on the server.

For the booking e2e test, we want to set a specific simulation time so I guess it also has to be used in Playwright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants