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

test: add a test moving average decaying even without new data #1141

Merged
merged 5 commits into from
Jun 22, 2021

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Jun 18, 2021

No description provided.

@@ -64,6 +65,50 @@ test('Exponential moving average has a configurable decay parameter', function(a
assert.equal(playlist.attributes.BANDWIDTH, 50, 'selected the middle playlist');
});

test('Calling exponential moing average wont decay average unless new bandwidth data was provided', function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('Calling exponential moing average wont decay average unless new bandwidth data was provided', function(assert) {
test('Calling exponential moving average won\'t decay average unless new bandwidth data was provided', function(assert) {

@@ -57,6 +59,11 @@ const options = {
}
defaults.module.unshift('replace');

if (NO_TEST_BUNDLE) {
defaults.module.unshift('strip');
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use rollup-plugin-stub in tests to prevent having to remove stuff from the main build? This is what we do in video.js https://github.com/videojs/video.js/blob/main/test/unit/player.test.js#L947-L955

Copy link
Member Author

Choose a reason for hiding this comment

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

Looked into this, I think that we don't want to use stub anymore. The repo is archived. Also, it adds a lot of time to the build.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to always strip this code from the module/browser build? I think we can just remove the if statement and always add the strip plugin.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, seem reasonable. I think I wasn't sure exactly how the test/mobule/browser builds stuff worked when I first added this.

@gkatsev gkatsev merged commit 55726af into main Jun 22, 2021
@gkatsev gkatsev deleted the moving-average-tests branch June 22, 2021 16:09
gkatsev added a commit that referenced this pull request Jun 22, 2021
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