Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: better target tests through vitest and set default browser config #1619

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

peaBerberian
Copy link
Collaborator

I'm PoCing a common config for most kinds of tests in the RxPlayer (integration, memory and unit tests, so we just exclude the very situational "performance" and "conformance" tests).

All three of them are relying on vitest but integration+memory tests run in a browser and unit tests run in a jsdom-ed Node.js environment.

With the goal of performing every tests in a web browser/user-agent to better reflect actual RxPlayer usage (in production, we need to run on something that has HTML5 video/audio and preferably EME+MSE, so Node.js isn't a realist target today) and of having the simplicity of just being able to call npx vitest to run all those tests with a common environment, I'm currently updating vitest configs and unit tests.

This PR is an offshoot of that work that is compatible to what we already do today:

  • vitest's config more explicitly include memory+integration tests.

  • I added a default browser (sadly, I chose here Chrome, for popularity and universality reasons) for when no browser is asked for (this is only useful when calling npx vitest directly, which we never do but which a developer could want to do - in which case running all tests in chrome would be better than just failing randomly).

I'm PoCing a common config for most kinds of tests in the RxPlayer
(integration, memory and unit tests, so we just exclude "performance"
and "conformance" tests).

All three of them are relying on `vitest` but integration+memory tests
run in a browser and unit tests run in a jsdom-ed Node.js environment.

With the goal of performing every tests in a web browser/user-agent to
better reflect actual RxPlayer usage (in production, we need to run on
something that has HTML5 video/audio and preferably EME+MSE, so Node.js
isn't a realist target today) and of having the simplicity of just being
able to call `npx vitest` to run all those tests with a common
environment, I'm currently updating `vitest` configs and unit tests.

This commit is an offshoot of that work that is compatible to what we
already do today:

  - `vitest`'s config more explicitly include memory+integration tests.

  - I added a default browser (sadly, I chose here Chrome, for
    popularity and universality reasons) for when no browser is asked
    for (this is only useful when calling `npx vitest` directly, which
    we never do but which a developer could want to do - in which case
    running all tests in chrome would be better than just failing
    randomly).
@peaBerberian peaBerberian added the tests Relative to the RxPlayer's tests label Dec 30, 2024
Copy link
Collaborator

@Florent-Bouisset Florent-Bouisset left a comment

Choose a reason for hiding this comment

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

👍

@peaBerberian peaBerberian merged commit 3dee043 into dev Jan 7, 2025
11 checks passed
@peaBerberian peaBerberian added this to the 4.3.0 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relative to the RxPlayer's tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants