[RFC]: Migrate from tape to in-house @stdlib/test/harness
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
- Lĩnh vực
- build-system, testing-qa, tooling
Hướng nghiên cứu
Bắt đầu bằng cách đọc @stdlib/test/harness được đề xuất cùng với các mẫu hiện có của @stdlib/bench/harness, sau đó kiểm tra các tệp kiểm thử trong lib, package.json, Makefile của stdlib và tools/harness.js. So sánh việc thực thi kiểm thử hiện tại dựa trên tape và đầu ra TAP với harness được đề xuất; công việc được xem là hoàn tất khi phạm vi di chuyển, các assertion được hỗ trợ và việc xác thực CI đã được thống nhất và hoạt động trên tất cả các kiểm thử bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
This RFC proposes
Proposal: Migrate stdlib Tests to In-House @stdlib/test/harness
This proposal delivers a tape-equivalent in-house test runner as @stdlib/test/harness, directly porting its minimal TAP API while matching @stdlib/bench/harness patterns. It eliminates the tape dep, supports only stdlib's used assertions (equal, strictEqual, ok, deepEqual, pass, fail, plan, end, test), and adds @stdlib/string/format interpolation—no parallelism, grouping, or extras like mocha/jest.
Before/After Test File
Before (tape):
'use strict';
var tape = require( 'tape' );
var foo = require( './../lib' );
tape( 'main export is a function', function test( t ) {
t.ok( true, 'should be true' );
t.strictEqual( typeof foo, 'function', 'main export is a function' );
t.end();
});
tape( 'computes correctly', function test( t ) {
t.plan( 2 );
t.equal( foo( 3 ), 9, 'returns 9' );
t.deepEqual( foo( ),, 'deep equal' );[1][2][3]
t.end();
After (@stdlib/test/harness):
After (@stdlib/test/harness):
```javascript
'use strict';
var test = require( '@stdlib/test/harness' );
var foo = require( './../lib' );
test( 'main export is a function', function test( t ) {
t.ok( true, 'should be true' );
t.strictEqual( typeof foo, 'function', 'main export is %s', 'function' );
t.end();
});
test( 'computes correctly', function test( t ) {
t.plan( 2 );
t.equal( foo( 3 ), 9, 'returns %d', 9 );
t.deepEqual( foo( ),, 'deep equal' );[1][2][3]
t.end();
});
Changes: Swap require('tape') → require('@stdlib/test/harness'). Assertions identical—no renames/refactors. Interpolation optional (%s/%d/%j via @stdlib/string/format).
Study of References
Reviewed tape source (tape-testing/tape): TAP stream via events, nested tests, async end(), assertion tracking. Compared to @stdlib/bench/harness: Similar b.bench()/test(), exports harness/stream factory, stdout TAP—no deps. Stdlib tests (e.g., Makefile/package.json scans): Use ~6 assertions max, plain TAP, no advanced tape features. Impl ports tape's core (test context, assert/incr count, TAP lines) to ~400 LOC Node streams.
Automation Strategy
- Publish
@stdlib/test/harness(bench mirror: libtests, Makefile). - Global replace:
grep -rl "require('tape')" lib/ | xargs sed -i "s|require('tape')|require('@stdlib/test\/harness')|g"(handles escapes). - Glob run: Update stdlib Makefile:
$(QUIET) $(NODE) $(TOOLS_DIR)/harness.js $(shell find lib -name 'test.*.js'). - Validate: CI diff old/new TAP (tape | harness); fix interpolation mismatches via optional post-sed (regex scan t.equal/ok args).
- Coverage: Stick with istanbul (nyc/c8 drops Node 10-12 compat).
Related Issues
[Idea]: develop a project test runner
Questions
No.
Other
No.
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:.
- Ngôn ngữ chính
- JavaScript
- Star
- 6k
- Fork
- 1.3k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 224
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stdlib-js/stdlib
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stdlib-js/stdlib#16655 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix JavaScript lint errorsCó thể đã có người làm @protestershankar đã nhận 5 ngày trước. Đang mởGood First Issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
stdlib-js/stdlib#16563 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix C lint errorsCó thể đã có người làm @raus7n đã nhận 14 ngày trước. Đang mởGood First Issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
stdlib-js/stdlib#16454 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix JavaScript lint errorsCó thể đã có người làm @Devansh-18155 đã nhận 39 ngày trước. Đang mởGood First Issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
stdlib-js/stdlib#15970 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix JavaScript lint errorsCó thể đã có người làm @lb1192176991-lab đã nhận 44 ngày trước. Đang mởGood First Issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
stdlib-js/stdlib#15831 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stdlib-js/stdlib
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automation chore ci-cd consistency developer-experience difficulty: easy discoverability documentation enhancement github-actions good first issue help wanted hygiene priority: P3 seo shell yaml
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
swc-project/swc-next-issues#394 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
githubnext/gh-aw-workshop#5790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
adobe/helix-tools-website#480 ·
Maintainer thường phản hồi trong vòng 1 ngày