Travis build: 1259 [custom]

This commit is contained in:
30secondsofcode
2018-01-16 14:20:25 +00:00
parent d11d20a129
commit e63c6bc840
9 changed files with 613 additions and 9 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();
});