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

Use native ES modules in karma #46

Merged
merged 2 commits into from May 27, 2019
Merged

Conversation

daKmoR
Copy link
Contributor

@daKmoR daKmoR commented May 16, 2019

No description provided.

@bashmish bashmish changed the title WIP: chore: update karma testing to use native es modules WIP: Use native ES modules in karma May 27, 2019
).to.equal(true);
expect(
isSameDate(getFirstDayNextMonth(new Date('2000/03/10')), new Date('2000/04/01')),
).to.equal(true);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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,
]);
Copy link
Contributor

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

@bashmish bashmish changed the title WIP: Use native ES modules in karma Use native ES modules in karma May 27, 2019
@bashmish bashmish self-requested a review May 27, 2019 14:35
@@ -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",
Copy link
Contributor

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

@bashmish bashmish merged commit 1eabb40 into master May 27, 2019
@bashmish bashmish deleted the chore/upgradeKarmaTesting branch May 28, 2019 13:36
fcarrascosa pushed a commit to fcarrascosa/lion that referenced this pull request Nov 28, 2019
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.

None yet

2 participants