@@ -28,21 +28,28 @@ describe('required params validator', () => {
2828 } ) ;
2929
3030 it ( 'should send method and fail on the service ID' , ( ) => {
31- emailjs . init ( 'user_LC2JWGTestKeySomething' ) ;
31+ emailjs . init ( {
32+ publicKey : 'LC2JWGTestKeySomething' ,
33+ } ) ;
3234
3335 expect ( ( ) => emailjs . send ( '' , 'my_test_template' ) ) . toThrow ( 'The service ID is required' ) ;
3436 } ) ;
3537
3638 it ( 'should send method and fail on the template ID' , ( ) => {
37- emailjs . init ( 'user_LC2JWGTestKeySomething' ) ;
39+ emailjs . init ( {
40+ publicKey : 'LC2JWGTestKeySomething' ,
41+ } ) ;
3842
3943 expect ( ( ) => emailjs . send ( 'default_service' , '' ) ) . toThrow ( 'The template ID is required' ) ;
4044 } ) ;
4145} ) ;
4246
4347describe ( 'emailjs.send method' , ( ) => {
4448 it ( 'should init and send method successfully' , async ( ) => {
45- emailjs . init ( 'user_LC2JWGTestKeySomething' ) ;
49+ emailjs . init ( {
50+ publicKey : 'LC2JWGTestKeySomething' ,
51+ privateKey : 'PrKeyTestKeySomething' ,
52+ } ) ;
4653
4754 try {
4855 const result = await emailjs . send ( 'default_service' , 'my_test_template' ) ;
@@ -58,7 +65,10 @@ describe('emailjs.send method', () => {
5865 'default_service' ,
5966 'my_test_template' ,
6067 { } ,
61- 'user_LC2JWGTestKeySomething' ,
68+ {
69+ publicKey : 'LC2JWGTestKeySomething' ,
70+ privateKey : 'PrKeyTestKeySomething' ,
71+ } ,
6272 ) ;
6373 expect ( result ) . toEqual ( { status : 200 , text : 'OK' } ) ;
6474 } catch ( error ) {
@@ -80,7 +90,10 @@ describe('emailjs.send method', () => {
8090 'default_service' ,
8191 'my_test_template' ,
8292 { } ,
83- 'user_LC2JWGTestKeySomething' ,
93+ {
94+ publicKey : 'LC2JWGTestKeySomething' ,
95+ privateKey : 'PrKeyTestKeySomething' ,
96+ } ,
8497 ) ;
8598 expect ( result ) . toBeUndefined ( ) ;
8699 } catch ( error ) {
0 commit comments