-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
argument.chain.test.js
33 lines (28 loc) · 1.04 KB
/
argument.chain.test.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
const { Argument } = require('../');
describe('Argument methods that should return this for chaining', () => {
test('when call .default() then returns this', () => {
const argument = new Argument('<value>');
const result = argument.default(3);
expect(result).toBe(argument);
});
test('when call .argParser() then returns this', () => {
const argument = new Argument('<value>');
const result = argument.argParser(() => { });
expect(result).toBe(argument);
});
test('when call .choices() then returns this', () => {
const argument = new Argument('<value>');
const result = argument.choices(['a']);
expect(result).toBe(argument);
});
test('when call .argRequired() then returns this', () => {
const argument = new Argument('<value>');
const result = argument.argRequired();
expect(result).toBe(argument);
});
test('when call .argOptional() then returns this', () => {
const argument = new Argument('<value>');
const result = argument.argOptional();
expect(result).toBe(argument);
});
});