Travis build: 1259 [custom]
This commit is contained in:
18
test/observeMutations/observeMutations.js
Normal file
18
test/observeMutations/observeMutations.js
Normal 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;
|
||||
};
|
||||
13
test/observeMutations/observeMutations.test.js
Normal file
13
test/observeMutations/observeMutations.test.js
Normal 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();
|
||||
});
|
||||
Reference in New Issue
Block a user