forked from ramda/ramda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendsWith.js
36 lines (28 loc) · 1.24 KB
/
endsWith.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var R = require('../source/index.js');
var eq = require('./shared/eq.js');
describe('endsWith', function() {
it('should return true when a string ends with the provided value', function() {
eq(R.endsWith('c', 'abc'), true);
});
it('should return true when a long string ends with the provided value', function() {
eq(R.endsWith('ology', 'astrology'), true);
});
it('should return false when a string does not end with the provided value', function() {
eq(R.endsWith('b', 'abc'), false);
});
it('should return false when a long string does not end with the provided value', function() {
eq(R.endsWith('olog', 'astrology'), false);
});
it('should return true when an array ends with the provided value', function() {
eq(R.endsWith(['c'], ['a', 'b', 'c']), true);
});
it('should return true when an array ends with the provided values', function() {
eq(R.endsWith(['b', 'c'], ['a', 'b', 'c']), true);
});
it('should return false when an array does not end with the provided value', function() {
eq(R.endsWith(['b'], ['a', 'b', 'c']), false);
});
it('should return false when an array does not end with the provided values', function() {
eq(R.endsWith(['a', 'b'], ['a', 'b', 'c']), false);
});
});