Travis build: 1259 [custom]

This commit is contained in:
30secondsofcode
2018-01-16 14:20:25 +00:00
parent 6f0bc1c818
commit 0aba4c5cdc
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();
});

View File

@ -1,4 +1,4 @@
Test log for: Tue Jan 16 2018 13:20:30 GMT+0000 (UTC)
Test log for: Tue Jan 16 2018 14:20:20 GMT+0000 (UTC)
> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code
> tape test/**/*.test.js | tap-spec
@ -734,6 +734,10 @@ Test log for: Tue Jan 16 2018 13:20:30 GMT+0000 (UTC)
✔ 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
@ -1142,8 +1146,8 @@ Test log for: Tue Jan 16 2018 13:20:30 GMT+0000 (UTC)
✔ Array was zipped to object
total: 489
passing: 489
duration: 512ms
total: 490
passing: 490
duration: 270ms