Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
19
test/observeMutations/observeMutations.js
Normal file
19
test/observeMutations/observeMutations.js
Normal file
@ -0,0 +1,19 @@
|
||||
const observeMutations = (element, callback, options) => {
|
||||
const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)));
|
||||
observer.observe(
|
||||
element,
|
||||
Object.assign(
|
||||
{
|
||||
childList: true,
|
||||
attributes: true,
|
||||
attributeOldValue: true,
|
||||
characterData: true,
|
||||
characterDataOldValue: true,
|
||||
subtree: true
|
||||
},
|
||||
options
|
||||
)
|
||||
);
|
||||
return observer;
|
||||
};
|
||||
module.exports = observeMutations;
|
||||
10
test/observeMutations/observeMutations.test.js
Normal file
10
test/observeMutations/observeMutations.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
const expect = require('expect');
|
||||
const observeMutations = require('./observeMutations.js');
|
||||
|
||||
|
||||
test('observeMutations is a Function', () => {
|
||||
expect(observeMutations).toBeInstanceOf(Function);
|
||||
});
|
||||
t.pass('Tested on 09/02/2018 by @chalarangelo');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user