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

Update webpack to version 4.12 #1118

Merged
merged 12 commits into from
Jul 5, 2018
Merged

Update webpack to version 4.12 #1118

merged 12 commits into from
Jul 5, 2018

Conversation

ma2ciek
Copy link
Contributor

@ma2ciek ma2ciek commented Jun 28, 2018

Suggested merge commit message (convention)

Other: Updated webpack to version 4.12.

@ma2ciek
Copy link
Contributor Author

ma2ciek commented Jun 28, 2018

I'll update one test in BalloonPanelView, as I got the following error message:

TypeError: ES Modules cannot be spied
          at Function.spy (base-dev/node_modules/sinon/pkg/sinon.js?51ef4aa3de92c43bc4721758a1e445182048177d:2342:15)
          at Object.spy (base-dev/node_modules/sinon/pkg/sinon.js?51ef4aa3de92c43bc4721758a1e445182048177d:863:34)
          at Context.it (webpack:///packages/ckeditor5-ui/tests/panel/balloon/balloonpanelview.js:176:0 <- build/.automated-tests/entry-point.js:4877:105)

@ma2ciek
Copy link
Contributor Author

ma2ciek commented Jun 29, 2018

Can I change the BalloonPanelView class, so it will contain a static method getOptimalPosition which will be an alias to the original getOptimalPosition method from @ckeditor/ckeditor5-utils/src/dom/position? Then I'll be able to mock that method in tests.

https://github.com/ckeditor/ckeditor5-ui/blob/0ed2b79379e1ea78559cf16ddc0863f6546ebb69/src/panel/balloon/balloonpanelview.js#L11

cc @Reinmar

@Reinmar
Copy link
Member

Reinmar commented Jun 29, 2018

cc @oleq

@oleq
Copy link
Member

oleq commented Jun 29, 2018

I guess so if there's no other way ;-) Why did that thing get broken in the first place, anyway?

@ma2ciek
Copy link
Contributor Author

ma2ciek commented Jun 29, 2018

We import position utils, which is a module

import * as positionUtils from '@ckeditor/ckeditor5-utils/src/dom/position';

And then we stub the module's export with:

const spy = testUtils.sinon.spy( positionUtils, 'getOptimalPosition' );

Which becames invalid now, as positionUtils is an ES Module, not a normal object. (I guess it).

@ma2ciek ma2ciek force-pushed the t/ckeditor5-dev/371 branch from f923300 to d47cfc5 Compare July 3, 2018 10:29
@Reinmar Reinmar merged commit 7390460 into master Jul 5, 2018
@Reinmar Reinmar deleted the t/ckeditor5-dev/371 branch July 5, 2018 13:27
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.

3 participants