Skip to content

vleedesigntheory/babel-plugin-testus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TestUS Logo

babel-plugin-testus

A Babel Plugin for TestUS

Principle

The whole plugin complies with the architectural design system of Babel, and performs corresponding syntax transformation on the source code through procedural steps.

architecture

The technical selection uses various dependency packages required by Babel to handle Babel 6.x and Babel 7.x, including: parser, traverse, and generator etc.

technology

Example

By configuring the plugins in babel.config.js or .babelrc, introduce babel-plugin-testus to realize syntax transformation. The configuration is as follows:

// babel.config.js
module.exports = {
    "plugins": [
        "babel-plugin-testus"
    ]
}

Before:

// @testus
const sum = (a,b) => a+b;

After:

/**
 * @testus 
 * @name sum
 * @param a
 * @param b
 * @testus
 */
const sum = (a,b) => a+b;

License

MIT

Copyright (c) 2023-present VLeeDesignTheory

Releases

No releases published

Packages

No packages published