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
Use native ES modules in karma #46
Conversation
f17f303
to
c91b821
Compare
c91b821
to
4d92a4c
Compare
).to.equal(true); | ||
expect( | ||
isSameDate(getFirstDayNextMonth(new Date('2000/03/10')), new Date('2000/04/01')), | ||
).to.equal(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests failed because of a different order of execution of tests and because they depended on the page locale
I refactored them to be locale independent, so now they work
).to.equal(true); | ||
expect( | ||
isSameDate(getLastDayPreviousMonth(new Date('2000/03/10')), new Date('2000/02/29')), | ||
).to.equal(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above with getFirstDayNextMonth
if (this.calendarEl) { | ||
completePromises.push(this.calendarEl.updateComplete); | ||
} | ||
return Promise.all(completePromises); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expects were run before the overlay finished first render, this fixes that
await Promise.all([ | ||
this._calendarOverlayElement.updateComplete, | ||
this._calendarElement.updateComplete, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed to fix this._calendarElement.focusCentralDate();
in _onCalendarOverlayOpened
, otherwise it is run before the overlay finished first render and the button within the calendar can not be focused yet since it is not yet in the viewport DOM
not sure how it works in the old karma setup, must be smth with transpilation which could have fixed it somehow, but it is good that we now have it working natively
4d92a4c
to
517f4c8
Compare
517f4c8
to
72760cf
Compare
@@ -41,7 +41,7 @@ | |||
"test:legacy:watch": "karma start --legacy --auto-watch=true --single-run=false", | |||
"test:update-snapshots": "karma start --update-snapshots", | |||
"test:prune-snapshots": "karma start --prune-snapshots", | |||
"test:bs": "karma start karma.bs.config.js --legacy --coverage", | |||
"test:bs": "karma start karma.bs.config.js --coverage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also had to remove --legacy
here since it is not compatible with new native ES modules
Use native ES modules in karma
No description provided.