Playing actual music over fp-ts
notes 🎶
Fortepiano is a mocking library for TypeScript. It promotes immutability, composability and purity, making it ideal for projects that embrace functional programming principles.
To install the stable version:
npm install fortepiano
or using yarn:
yarn add fortepiano
Fortepiano uses a functional API to create and configure mocks, encouraging pure function usage and immutable mock objects.
Here's an example:
import { $mock } from 'fortepiano'
interface User {
firstName: string
lastName: string
}
export const UserMock = (): $mock.Mock<User> =>
$mock.struct({
firstName: $mock.string,
lastName: $mock.string,
})
console.log(UserMock()()()) // Output: { firstName: 'randomString', lastName: 'randomString' }
See the CONTRIBUTING.md file for details.
This project is licensed under the MIT License. See the LICENSE.md file for details.