smart-testing

smart-testing 公共库

Usage no npm install needed!

<script type="module">
  import smartTesting from 'https://cdn.skypack.dev/smart-testing';
</script>

README

smart-testing

A npm package that deals with a C++ project before running.

Installation

npm i smart-testing

1. fuzzy 设置自定义依赖文件

  • extensions 头文件列表
  • output: 输出文件路径
  • filters 筛选项
    • extensions 文件后缀名列表
const pretreat = require('smart-testing')

pretreat.fuzzy(filePath, output, filters);
  .then(() => {
    console.log('done');
  })
  .catch((err) => {
    console.log(err);
  });

2. custom 设置依赖文件

  • filePath 文件路径
  • includes: 自定义依赖文件路径
  • output: 输出文件路径
  • extensions 文件后缀名列表
pretreat.custom(filePath, includes, output, extensions)
  .then(() => {
    console.log('done');
  })
  .catch((err) => {
    console.log(err);
  });

3. translate 根据平台转换代码

  • filePath: 文件路径
  • platform: 适应平台
pretreat.translate(filePath, platform))
  .then(() => {
    console.log('done');
  })
  .catch((err) => {
    console.log(err);
  });

4. copyFolder 复制文件夹

  • src 原文夹路径
  • tar 目标路径
  • extensions 文件后缀名列表
pretreat.copyFolder(src, tar, extensions))
  .then(() => {
    console.log('done');
  })
  .catch((err) => {
    console.log(err);
  });

3. smart-init 新建项目

smart-init projectName

4. publish

publish:prerelease: 1.0.16-0 => 1.0.16-1,
publish:prepatch: 1.0.16 => 1.0.17-1,
publish:preminor: 1.0.16 => 1.1.0-0,
publish:premajor: 1.0.16 => 2.0.0-0,
publish:patch: 1.0.17-1 => 1.0.17 需先使用 publish:prepatch,
publish:minor: 1.1.0-1 => 1.1.0 需先使用 publish:preminor,
publish:major: 2.0.0-1 => 2.0.0 需先使用 publish:premajor

5. statistics

处理报文信息