Typescript-TDD/ts-auto-mock
关于
让接口和类能够自动创建 mock 的 TypeScript 转换器
开发工具可以做什么
- Typescript transformers works only when using the tsc typescript compiler. If you are using esbuild or swc you will not be able to use this library.
- Test double are a double-edge sword. They have to be used carefully and at the right time. Increasing the number of test doubles could decrease the value of your tests. The amount of configuration required by this library might not justify the amount of test doubles that your application requires.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文TS auto mock
Need help? Join us
on Slack
:warning: This repository is now no longer maintained for new features development :warning:
A few years ago we've created this project with the idea in mind that typescript transformers would be easier to configure.
Unfortunately the typescript team has no intention to improve the developer experience. You can see more information at this link.
We believe that stop developing new features is the best decision to inform who is currently using it and who find it for the first time.
We will keep fixing bugs and vulnerability.
Other reasons why this library might not be for you:
- Typescript transformers works only when using the tsc typescript compiler. If you are using esbuild or swc you will not be able to use this library.
- Test double are a double-edge sword. They have to be used carefully and at the right time. Increasing the number of test doubles could decrease the value of your tests. The amount of configuration required by this library might not justify the amount of test doubles that your application requires.
A TypeScript transformer that will allow you to create mocks for any types (interfaces, classes, etc.) without the need to create manual fakes/mocks.
API Documentation
Installation
Usage
Quick overview
import { createMock } from 'ts-auto-mock';
interface Person {
id: string;
getName(): string;
details: {
phone: number
}
}
const mock = createMock<Person>();
mock.id // ""
mock.getName() // ""
mock.details // "{ phone: 0 }"
- If you are interested to use it with jasmine please go to jasmine-ts-auto-mock
- If you are interested to use it with jest please go to jest-ts-auto-mock
Changelog
Find the changelog here: Changelog.
Roadmap
You can find the roadmap of this project on the Wiki page: Roadmap.
Do you want to contribute?
Authors
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Artem Kornev 🐛 💻 |
Fabian 🐛 💻 |
Geoffrey 'C0ZEN' Testelin 🐛 💻 🤔 🔧 |
Giulio Caprino 💬 💻 📖 🤔 🚇 🚧 📆 |
Marc 🐛 💻 |
Martin Jesper Low Madsen 🐛 💻 🤔 |
Vittorio Guerriero 💬 💻 🤔 🚇 🚧 📆 🔧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Sponsor ✨
Thanks to these people
|
Kenta Mukai |
License
This project is licensed under the MIT License
探索相关项目
加载中…