Skip to content

isolcat/babel-plugin-testdev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐱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

pnpm add babel-plugin-testdev

Configure

You just need to do this:

// babel.config.js
module.exports = {
  plugins: ["testdev"],
};

At the time of testing:

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

About

The babel plugin for hiding your test code

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages