Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // a.js
- let a;
- export const setA = () => {
- a = 5;
- };
- export const getA = () => {
- if(!a) { throw new Error() }
- return a;
- }
- // a.spec.js
- describe('a', () => {
- it('test setA', () => {
- setA();
- });
- it('should throw a is not set', () => {
- expect(() => getA()).toThrow(Error);
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement