Merge branch 'master' into urlJoin

This commit is contained in:
Angelos Chalaris
2018-01-16 18:48:59 +02:00
committed by GitHub
25 changed files with 821 additions and 1550 deletions

View File

@ -0,0 +1,18 @@
module.exports = 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;
};

View File

@ -0,0 +1,13 @@
const test = require('tape');
const observeMutations = require('./observeMutations.js');
test('Testing observeMutations', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof observeMutations === 'function', 'observeMutations is a Function');
//t.deepEqual(observeMutations(args..), 'Expected');
//t.equal(observeMutations(args..), 'Expected');
//t.false(observeMutations(args..), 'Expected');
//t.throws(observeMutations(args..), 'Expected');
t.end();
});

View File

@ -721,6 +721,10 @@ Test log for: Tue Jan 16 2018 15:31:32 GMT+0200 (GTB Standard Time)
√ objectToPairs is a Function
√ Creates an array of key-value pair arrays from an object.
Testing observeMutations
✔ observeMutations is a Function
Testing off
√ off is a Function
@ -1153,3 +1157,4 @@ Test log for: Tue Jan 16 2018 15:31:32 GMT+0200 (GTB Standard Time)
duration: 345ms