From beacf249716a81b0485c68c60939f0920fe2dc47 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Mon, 12 Mar 2018 20:37:13 +0000 Subject: [PATCH] Travis build: 1810 [cron] --- test/prefix/prefix.js | 9 +++++++++ test/prefix/prefix.test.js | 13 +++++++++++++ test/testlog | 12 ++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 test/prefix/prefix.js create mode 100644 test/prefix/prefix.test.js diff --git a/test/prefix/prefix.js b/test/prefix/prefix.js new file mode 100644 index 000000000..05515078e --- /dev/null +++ b/test/prefix/prefix.js @@ -0,0 +1,9 @@ +const prefix = prop => { +const capitalizedProp = prop.charAt(0).toUpperCase() + prop.slice(1); +const prefixes = ['', 'webkit', 'moz', 'ms', 'o']; +const i = prefixes.findIndex( +prefix => typeof document.body.style[prefix ? prefix + capitalizedProp : prop] !== 'undefined' +); +return i !== -1 ? (i === 0 ? prop : prefixes[i] + capitalizedProp) : null; +}; +module.exports = prefix; \ No newline at end of file diff --git a/test/prefix/prefix.test.js b/test/prefix/prefix.test.js new file mode 100644 index 000000000..846d951c1 --- /dev/null +++ b/test/prefix/prefix.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const prefix = require('./prefix.js'); + +test('Testing prefix', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof prefix === 'function', 'prefix is a Function'); + //t.deepEqual(prefix(args..), 'Expected'); + //t.equal(prefix(args..), 'Expected'); + //t.false(prefix(args..), 'Expected'); + //t.throws(prefix(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 056610889..b361983c0 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sun Mar 11 2018 20:35:52 GMT+0000 (UTC) +Test log for: Mon Mar 12 2018 20:37:06 GMT+0000 (UTC) > 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1298,6 +1298,10 @@ Test log for: Sun Mar 11 2018 20:35:52 GMT+0000 (UTC) ✔ powerset is a Function ✔ Returns the powerset of a given array of numbers. + Testing prefix + + ✔ prefix is a Function + Testing prettyBytes ✔ prettyBytes is a Function @@ -1959,8 +1963,8 @@ Test log for: Sun Mar 11 2018 20:35:52 GMT+0000 (UTC) ✔ Works with multiple promises - total: 997 - passing: 997 - duration: 2.4s + total: 998 + passing: 998 + duration: 2.5s