|
1 | | -import { it, expect } from '@jest/globals'; |
| 1 | +import { it, expect, describe } from '@jest/globals'; |
2 | 2 | import { validateParams } from './validateParams'; |
3 | 3 |
|
4 | | -it('should fail on the public key', () => { |
5 | | - expect(() => validateParams('', 'default_service', 'my_test_template')).toThrow( |
6 | | - 'The public key is required', |
7 | | - ); |
| 4 | +describe('should fail on the public key', () => { |
| 5 | + it('no key', () => { |
| 6 | + expect(() => validateParams('', 'default_service', 'my_test_template')).toThrow( |
| 7 | + 'The public key is required', |
| 8 | + ); |
| 9 | + }); |
| 10 | + |
| 11 | + it('invalida type', () => { |
| 12 | + expect(() => validateParams({}, 'default_service', 'my_test_template')).toThrow( |
| 13 | + 'The public key is required', |
| 14 | + ); |
| 15 | + }); |
8 | 16 | }); |
9 | 17 |
|
10 | | -it('should fail on the service ID', () => { |
11 | | - expect(() => validateParams('d2JWGTestKeySomething', '', 'my_test_template')).toThrow( |
12 | | - 'The service ID is required', |
13 | | - ); |
| 18 | +describe('should fail on the service ID', () => { |
| 19 | + it('no key', () => { |
| 20 | + expect(() => validateParams('d2JWGTestKeySomething', '', 'my_test_template')).toThrow( |
| 21 | + 'The service ID is required', |
| 22 | + ); |
| 23 | + }); |
| 24 | + |
| 25 | + it('invalida type', () => { |
| 26 | + expect(() => validateParams('d2JWGTestKeySomething', [], 'my_test_template')).toThrow( |
| 27 | + 'The service ID is required', |
| 28 | + ); |
| 29 | + }); |
14 | 30 | }); |
15 | 31 |
|
16 | | -it('should fail on the template ID', () => { |
17 | | - expect(() => validateParams('d2JWGTestKeySomething', 'default_service', '')).toThrow( |
18 | | - 'The template ID is required', |
19 | | - ); |
| 32 | +describe('should fail on the template ID', () => { |
| 33 | + it('no key', () => { |
| 34 | + expect(() => validateParams('d2JWGTestKeySomething', 'default_service', '')).toThrow( |
| 35 | + 'The template ID is required', |
| 36 | + ); |
| 37 | + }); |
| 38 | + |
| 39 | + it('invalida type', () => { |
| 40 | + expect(() => validateParams('d2JWGTestKeySomething', 'default_service', 3)).toThrow( |
| 41 | + 'The template ID is required', |
| 42 | + ); |
| 43 | + }); |
20 | 44 | }); |
21 | 45 |
|
22 | 46 | it('should successfully pass the validation', () => { |
|
0 commit comments