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

Add frontend test infrastructure for video player app #907

Merged
merged 3 commits into from
May 2, 2023

Conversation

robertknight
Copy link
Member

Depends on #905

This PR adds our standard frontend testing infrastructure to Via for use with the video player app, and a simple test module (HypothesisClient-test.js). It also adds a GitHub CI workflow to run the tests.

The infrastructure is copied and tweaked from the lms repo, minus a few vestigial things I removed. One intentional change is that the file that sets up the global JS environment in the tests is called setup-tests.js in this repo, rather than bootstrap.js as in other repos. This seems like a much more obvious name to me.

Copy link
Contributor

@acelaya acelaya left a comment

Choose a reason for hiding this comment

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

One intentional change is that the file that sets up the global JS environment in the tests is called setup-tests.js in this repo, rather than bootstrap.js as in other repos. This seems like a much more obvious name to me.

Agree

Base automatically changed from video-player to main May 2, 2023 12:44
Add frontend unit testing infrastructure using our standard stack (Karma, mocha,
chai, sinon, Enzyme etc.)

Some notes:

 - We don't have any CommonJS runtime dependencies, but some of our test deps
   are still CJS, so we still need Rollup's CJS plugin for those.

 - Tests produce a warning about a `build/styles/*.css` pattern in
   karma.config.js not matching any files. This is because the video player
   doesn't have any CSS yet. That will change soon.

 - The setup file for the test environment was named `setup-tests.js` in this
   project rather than `bootstrap.js` as in other projects. I feel that the
   bootstrap name is completely non-obvious and we should change it.
This is expected by the GitHub CI workflow I'm about to add. This
project will have linting, I just haven't added it yet.
Copy frontend CI steps from GitHub CI workflows in the lms project.
@robertknight robertknight force-pushed the video-player-tests branch from 00c049b to a903008 Compare May 2, 2023 12:45
@robertknight robertknight merged commit c50a09d into main May 2, 2023
@robertknight robertknight deleted the video-player-tests branch May 2, 2023 12:48
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