mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-25 06:49:15 +01:00
19 lines
430 B
JavaScript
Vendored
19 lines
430 B
JavaScript
Vendored
import test from 'ava';
|
|
import substr from './../substr';
|
|
|
|
test('module should be a function', t => {
|
|
t.is(typeof substr, 'function');
|
|
});
|
|
|
|
test('should substring "Hello"', t => {
|
|
t.is(substr('Hello World!', 0, 5), 'Hello');
|
|
});
|
|
|
|
test('should substring "World!"', t => {
|
|
t.is(substr('Hello World!', 6), 'World!');
|
|
});
|
|
|
|
test('should return value if it is not correct', t => {
|
|
t.deepEqual(substr({}, 0, 5), {});
|
|
});
|