Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamataryo/sandbox-serverless-di-pattern
https://github.com/kamataryo/sandbox-serverless-di-pattern
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kamataryo/sandbox-serverless-di-pattern
- Owner: kamataryo
- Created: 2020-05-23T08:11:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T02:39:58.000Z (almost 2 years ago)
- Last Synced: 2023-09-17T00:27:49.266Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sandbox Serverless DI Pattern
![Node.js CI](https://github.com/kamataryo/sandbox-serverless-di-pattern/workflows/Node.js%20CI/badge.svg)
A sandbox to test Lambda function with Dependencies Injection Pattern.
## Description
The handler `src/hello.handler` has `src/handler.dependencies` as a DI container.
You can inject a dependencies at test:```javascript
const { dependencies, handler } = require("src/hello.js");
dependencies.saas = () => {
/* Write your own mock here. */
};// Write any test
// ...
```Check `src/hello.test.js` as an actual example.
## try test
```shell
$ git clone [email protected]:kamataryo/sandbox-serverless-di-pattern.git
$ cd sandbox-serverless-di-pattern
$ yarn
$ npm t
```