File: test.js

package info (click to toggle)
node-repeating 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 100 kB
  • sloc: makefile: 2; sh: 2
file content (14 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import test from 'ava';
import m from './';

test('error', t => {
	t.throws(() => m(5, 5), 'Expected `input` to be a `string`, got `number`');
	t.throws(() => m(-5, 'foo'), 'Expected `count` to be a positive finite number, got `-5`');
});

test('repeating', t => {
	t.is(m(5), '     ');
	t.is(m(5, ''), '');
	t.is(m(5, 'a'), 'aaaaa');
	t.is(m(3, 'unicorn'), 'unicornunicornunicorn');
});