1.2.1 • Published 3 years ago

jtm v1.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

jtm

如果你用过 ava、tap,会发现它们的执行速度真的很慢。特别是 ava 慢的难以置信,且大量占用 CPU,导致糟糕的开发体验。

tape 性能还不错,但它依然是个半成品,需要自行扩充,而且必须使用 end()方法来结束测试代码,这样做似乎显得有些多余。

特性

  • 启动和执行速度超快

  • 轻量无依赖

  • 使用 ava 测试代码风格,部分兼容 ava 测试代码

  • 仅使用 node.js 内置的 assert 断言模块

示例

import test from "jtm";

test("hello", (t) => {
  t.deepEqual({ a: 1 }, { a: 1 });

  t.equal(true, true);
});

test("async", async (t) => {
  t.equal(true, true);

  t.ok(true);
});

安装

全局安装,运行时自动注入依赖包

npm install jtm -g

命令行参数使用

jtm 命令在无参数时默认执行 test 目录下的所有.js 测试文件。

# 未指定路径时,默认执行./test/目录下的所有.js文件
jtm

# 执行指定目录下的全部.js文件
jtm ./test/abc/

# 执行完整路径的单个.js文件
jtm ./test/abc.js

# 执行完整路径的单个.js文件,且仅执行指定名称的最小测试单元
jtm ./test/index.js:hello
1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.10

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7-rc

4 years ago

0.0.7

4 years ago

0.0.4-rc

4 years ago

0.0.6-rc

4 years ago

0.0.5-rc

4 years ago

0.0.3-rc

4 years ago

0.0.0-rc

4 years ago