
Learn outside-in TDD to build a node and typescript rest API from an open specification file, writing tests with the Jazz Library and storing data in a Mongolia database.
Explore the OpenAPI specification file that defines two endpoints, their request and response shapes, and schemas for secrets and messages, including status codes like 200 and 400.
Initialize the project by copying a script, create folders for goals and tasks, install libraries including Typekit, generate the TypeScript and desk configuration files, run tests, and confirm everything works.
Explore starting an integration/acceptance test for a Node and TypeScript API, wiring Express routes and a controller, and validating 400 and 500 error responses against the database.
Learn to write the first green acceptance test for a controller in a Node and TypeScript API, applying outside-in TDD, validating requests, and handling errors.
Extend the controller and error handler with integration tests for not found and validation errors, refactor duplication into a shared service, and implement secret retrieval in node and typescript.
Reorganize the project folder structure to separate domain, infra, models, and controllers, and streamline imports for a clearer REST flow. Align integration tests to green through this refactor.
Drive a one-time secret retriever service with tests, using a repository to fetch and delete the secret, throwing when not found.
Explore pass get secrets acceptance tests in a node and typescript API using outside-in TDD. Implement and verify secret retrieval, error handling, and repository interactions through tests.
Implement a Node and TypeScript controller using outside-in TDD, validating request bodies for secrets, wiring unit and integration tests, and persisting secrets with appropriate HTTP responses.
Build the secret storer service using outside-in TDD in Node and TypeScript, implementing token generation, repository storage, and integration tests to manage secrets.
Implement the token generator by wiring the token generator interface to the unique-id library and prepare unit tests that walk the real library, then run integration tests.
Extend the secret repository by implementing the missing store operation and wiring tests to persist secrets into the database, using outside-in TDD in Node and TypeScript.
Explore unhandled errors in outside-in tdd for API development by simulating a failing create operation in integration tests and ensuring a 500 response with a meaningful error body.
Refactor iii walks through reorganizing a node and TypeScript api project, moving domain, interfaces, repositories, models, and external services, and restructuring controllers and tests with imports verification.
In this course we will implement a REST API in Node with express and typescript. We will store data in a mongodb database using mongoose. In order to implement this REST API, we will receive an OpenAPI Specification (OAS) file that will be the base to design and build our application.
The API we are going to build is a clone of the One Time Secret site. We will create an application that stores our secrets and provides us a URL to access them later, but with the condition that we can access that URL one time only. Whenever we attempt to retrieve the same secret again, hitting the same URL for a second time, we will receive an error.
Given that we already know how the public interface would look like with the OpenAPI Specification file provided, we will be using Test Driven Development (TDD) but following an Outside-In approach, also known as mockist approach or London School TDD. We will start writing the acceptance criteria tests, keeping them in red, we will start the double cycle and write unit tests for the inner components. That way we will build our way inside the application, one level at a time until we can make the acceptance test completely pass. While coding, even though we already have a quite clear direction of our application design, we will try to get inspired with DDD, Hexagonal Architecture and CQRS.
Kudos to @Panos for the constructive feedback that helped to make this course better.