https://github.com/isolcat/babel-plugin-testdev
The babel plugin for hiding your test code
https://github.com/isolcat/babel-plugin-testdev
Last synced: 11 months ago
JSON representation
The babel plugin for hiding your test code
- Host: GitHub
- URL: https://github.com/isolcat/babel-plugin-testdev
- Owner: isolcat
- License: mit
- Created: 2022-11-19T07:04:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-20T08:56:09.000Z (over 3 years ago)
- Last Synced: 2024-10-24T04:34:04.959Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐱babel-plugin-testdev
The babel plugin for hiding your test code
## Motivation
There are already many unit testing frameworks on the market, such as: `vitest`, `jest`, but if you do not want to or do not have the energy to learn unit testing.
You may wish to use the plug-in, you do not need any learning costs to solve some simple tests😽
## Install
```shell
pnpm add babel-plugin-testdev
```
## Configure
You just need to do this:
```js
// babel.config.js
module.exports = {
plugins: ["testdev"],
};
```
At the time of testing:
```js
if(TEST){
//Fill in the code you want to test here, he will be hidden in production
}
```
You can also do your own testing in the `test` file