Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
This commit is contained in:
3
test6/truncateString/truncateString.js
Normal file
3
test6/truncateString/truncateString.js
Normal file
@ -0,0 +1,3 @@
|
||||
const truncateString = (str, num) =>
|
||||
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
||||
module.exports = truncateString;
|
||||
9
test6/truncateString/truncateString.test.js
Normal file
9
test6/truncateString/truncateString.test.js
Normal file
@ -0,0 +1,9 @@
|
||||
const expect = require('expect');
|
||||
const truncateString = require('./truncateString.js');
|
||||
|
||||
test('Testing truncateString', () => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
expect(typeof truncateString === 'function').toBeTruthy();
|
||||
expect(truncateString('boomerang', 7)).toBe('boom...');
|
||||
});
|
||||
Reference in New Issue
Block a user