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 # of dom operations with MutationObserver #6

Open
jamesplease opened this issue Dec 22, 2014 · 8 comments
Open

Test # of dom operations with MutationObserver #6

jamesplease opened this issue Dec 22, 2014 · 8 comments
Assignees
Labels

Comments

@jamesplease
Copy link
Owner

Every action in Puppets should cause at most 2 DOM operations: one for removing what used to be there, and another for adding the new content.

I can test this with MutationObserver.

Q: does JSDom support mutation observer?

@jamesplease
Copy link
Owner Author

Q: does JSDom support mutation observer?

A: no

😢

Q2: does phantom support mutation observer? If so, I may switch over.

A2: Phantom 2.0 does apparently, but...it isn't released? Or something? Yup, still in development, so I don't know why they closed that issue.

For my purposes, no, it does not.

Polymer has a polyfill over here that I should look into. It'd be awesome if this polyfill works with JSDom.

@jridgewell
Copy link

@megawac also has a MutationObserver shim.

@megawac
Copy link

megawac commented Dec 22, 2014

Neither polymers or my implementation will do what you want (we batch after a timeout). You can consider using slimer or firefox + xfvb

@jamesplease
Copy link
Owner Author

:(

@jamesplease
Copy link
Owner Author

@megawac messaged me some good libraries to check out to implement slimer. The big one is this karma adapter. And apparently there's a mocha adapter for karma, as well.

I guess I'll go the slimer route, assuming it supports MutationObserver.

Thanks for the suggestions @megawac.

@jridgewell
Copy link

Karma is awesome. Feel free to reference Minionette for setup.

@jamesplease
Copy link
Owner Author

Definitely will. Thanks @jridgewell :)

@jamesplease jamesplease self-assigned this Dec 23, 2014
@jamesplease
Copy link
Owner Author

Until I get Karma and Slimer set up I made a quick little repo for testing this sort of thing. Check it out here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants