Travis build: 1810 [cron]
This commit is contained in:
9
test/prefix/prefix.js
Normal file
9
test/prefix/prefix.js
Normal file
@ -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;
|
||||
13
test/prefix/prefix.test.js
Normal file
13
test/prefix/prefix.test.js
Normal file
@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user