Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adrianomonteiroweb/solid-testable-api-architecture

Repository of architectural studies of a testable api with SOLID concepts in classes and TypeScript.
https://github.com/adrianomonteiroweb/solid-testable-api-architecture

api nodejs solid typescript unit-testing vitest

Last synced: 19 days ago
JSON representation

Repository of architectural studies of a testable api with SOLID concepts in classes and TypeScript.

Awesome Lists containing this project

README

        

# SOLID TESTABLE API ARCHITECTURE

Repository of architectural studies of a testable api with SOLID concepts in classes and TypeScript.

### TECHNOLOGIES

- DevDependencies:

- Eslint Standard;
- To standardize formatting during development.
- Vitest;
- Test module compatible with jest, typescript and others...
- date-fns.
- Used for handling dates in a function to generate future dates.

### ENTITIES

```bash
...
├── src
├── entities
...
├── Appointment.ts
...
├── repositories
├── tests
├── use-cases
...
```

- Appointment:

- customer;
- startAt;
- endAt.

### USE CASES

```bash
...
├── src
├── entities
├── repositories
├── tests
├── use-cases
...
├── create-appointment.ts
...
...
```

- create-appointment:
- CreateAppointment.

### REPOSITORIES

```bash
...
├── src
├── entities
├── repositories
├── in-memory
├── appointment-repository.ts
├── tests
├── use-cases
...
```

- appointment-repository.

### TESTING THE APPLICATION

- Functions
- get-future-date
- Increases date with one year.

```bash
...
├── src
├── entities
├── repositories
├── tests
├── utils
...
├── get-future-date.ts
...
├── use-cases
...
```

- For application test, running:

```zsh
npm test
```

```bash
...
├── src
├── entities
...
├── appointment.spec.ts
...
├── repositories
├── tests
├── utils
...
├── get-future-date.spec.ts
...
├── use-cases
...
├── create-appointment.spec.ts
...
...
```

### REFERENCE





Rocketseat




Rocketseat



Youtube