Skip to content

it's sample project to understand how mock works with aws.

Notifications You must be signed in to change notification settings

tuan231195/aws-sns-mock-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-sns-mock-test

it's sample project to understand how mock works with aws. Example with SNS.

Purpose

Succeed to make sure that the sns message is sent with specific parameter by calling snsService.publishMessage()

Installation

run : npm install

Folder /succeed

/succeed/method1

In this case, we import SNS by import { SNS } from 'aws-sdk'; That works as expected.

run:

npm run test-succeed

/succeed/method2

The implementation in /succeed/method2 fixes the failure/method1.test.js by using import SNS from 'aws-sdk/clients/sns'; https://stackoverflow.com/a/64404039/11465286

Folder /failure

In this case, we import SNS by import SNS from 'aws-sdk/clients/sns'; Impossible to make it work.

Two ways to test it :

run:

npm run test-failure

About

it's sample project to understand how mock works with aws.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%