Comments (7)
I think it's because babel.config.js
support was added on babel 7 beta 46, and we are currently at 41. I'll update babel 7 packages and push the changes if I get JSX working.
from cassette.
If you're here from Hacktoberfest you can also help out by adding documentation! 😃
from cassette.
@danielr18 I've push a branch called in-progress-test-setup
. I worked on it a few nights ago. It has a small example snapshot test and jest configuration. However it seems like the JSX transform isn't working. Not sure what I did wrong, and I was too tired to spend more time on it. I can look again sometime but if you have any idea and want to help out, that would be appreciated. :) If not, I'll get to it eventually.
If you want to check it out locally you'll need to run:
git checkout in-progress-test-setup
$(npm bin)/lerna bootstrap # installs all the test dependencies
npm test
from cassette.
Ah!! You're probably right, I forgot I was still on an old beta version.
from cassette.
Jest stuff is now merged into the next branch. I've added one passing snapshot test for now, as a starting point. Obviously we want more coverage. :) I'll leave this issue open until we get there.
from cassette.
This comment was originally posted here but makes more sense in the general testing issue:
I think Jest is a good tool to use. I could use some help brainstorming, but here's a starter checklist:
Component snapshot tests
@cassette/player
Each of these should be wrapped in context providers with mock values (the actual Context.Provider, not the smart wrapper):
-
MediaPlayerControls
- All the control components
- Stuff that might be hard to test:
VolumeControl
- can we mock different internal states?
@cassette/components
-
ProgressBarDisplay
- Maybe
ProgressBar
(just to mock theadjusting
state?) -
MaybeMarquee
-
VideoDisplay
- Stuff that might be hard to test:
- Potentially everything except for
ProgressBarDisplay
? These might be lower priority, especially since they're each so dependent on the DOM and on internal states.
- Potentially everything except for
Unit tests for util functions
The various separated util functions could all have tests, and perhaps new util functions could be pulled out
Context tests
It might require some refactoring and some mocks e.g. of the HTMLVideoElement, but it would be good to have API tests for the playerContext
and fullscreenContext
. I'm imagining that for the majority of functions available through the context, we have a test or tests that call the function then check afterward that:
- The expected update occurred in the mock HTMLVideoElement
- The expected change occurred in the context
Many of these updates will be asynchronous and some might even not be done on the next tick, so coding this could be tricky.
Mocking stuff from the browser will be an issue to resolve.
from cassette.
These tests don't need to be done before the beta release is out. They can be part of the beta stabilization phase.
from cassette.
Related Issues (20)
- Add Sass section to @cassette/player docs
- Update CONTRIBUTING doc
- ContextProvider/Consumer not working as expected HOT 22
- Google Chrome - Rewind media not working HOT 6
- Address getting started pain points
- Remove support for unsupported `displayText` property on track
- Officially migrate to @cassette packages on npm
- Example: fork Webamp and adapt to use Cassette
- Timidity midi playback plug-in (?)
- How can context updates be streamlined to cut out extraneous work?
- Handling media element errors HOT 6
- Let PlayerContextGroup handle media outside of Cassette
- Timestamp rounds up to nearest second, MediaStatusBar momentarily reads :60 HOT 2
- Set up Cypress for testing HOT 1
- Need help, not sure if I'm doing everything right. HOT 6
- Snapshot not updating PlayerContextProvider state when playlist changes. HOT 7
- Snapshot not updating PlayerContextProvider state if playlist contains different track urls HOT 5
- Setting index in PlayerContextProvider outside HOT 6
- Correct way to set pause after a track is finished but before jumping to the next HOT 1
- onSelectTrackIndex always starts playing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cassette.