Skip to content

Commit 6431dd7

Browse files
committed
test: add more test #5
Signed-off-by: seven <[email protected]>
1 parent 9425ae9 commit 6431dd7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/stack/validate.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ describe('unit test for validate', () => {
106106
target: 'hello',
107107
},
108108
},
109-
};
110-
expect(() => validateYaml(invalidYaml as unknown as RawServerlessIac)).toThrow('Invalid yaml');
109+
} as unknown as RawServerlessIac;
110+
expect(() => validateYaml(invalidYaml)).toThrow('Invalid yaml');
111+
});
112+
113+
it('should throw error when functions are not specified', () => {
114+
const invalidYaml = {
115+
...jsonIac,
116+
functions: null,
117+
} as unknown as RawServerlessIac;
118+
expect(() => validateYaml(invalidYaml)).toThrow('Invalid yaml');
111119
});
112120
});

0 commit comments

Comments
 (0)