Run the unit tests using Jest.
-
Clone the AWS Code Samples repo to your local environment. See the Github documentation for instructions.
-
Navigate to the javascript3/example_code folder.
cd javascriptv3/example_code
- Install Jest using npm.
npm install --save-dev jest
NOTE: For more information on installing Jest, see Jest - Getting Started.
- Navigate to the directory containing the files you want to test. For example:
cd tests/s3
-
Change the extension of the files you're testing from
.ts
to.js
. -
Add
module.exports ={*}
to the bottom of each file your testing. -
Run tests.
npm run test