Skip to content

Commit 4bb43e2

Browse files
committed
added function-builder test
Signed-off-by: Antonio Mendoza Pérez <antmendoza@gmail.com>
1 parent 1f756a1 commit 4bb43e2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/lib/builders/function-builder.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@
1717
import { functionBuilder } from '../../../src/lib/builders/function-builder';
1818

1919
describe('function ', () => {
20-
it('should build an object without default type', () => {
20+
it('should build an object without default type if not set', () => {
2121
const fn = functionBuilder().name('function').operation('operation').build();
2222

2323
expect(fn.type).toBeUndefined();
2424
});
25+
26+
it('should build an object with type= set value ', () => {
27+
expect(functionBuilder().name('function').operation('operation').type('expression').build().type).toBe(
28+
'expression'
29+
);
30+
expect(functionBuilder().name('function').operation('operation').type('rest').build().type).toBe('rest');
31+
});
2532
});

0 commit comments

Comments
 (0)