avajs/ava

Support running a test function multiple times with different data

開放

#2,980 建立於 2022年2月26日

 (11 則留言) (0 個反應) (0 位負責人)JavaScript (1,408 個分叉)batch import
enhancementhelp wantedscope:test-interface

倉庫指標

星標
 (20,600 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

You can already do this with macros, but it's a bit verbose and complicated. It would be nice to simplify the common case of just running the same test over an array of fixtures.

Possible API:

test('validate email', t => {
	console.log(t.data);
	t.true(isString(t.data));
})
.data([
	'foo',
	'bar'
]);
//=> 'foo'
//=> 'bar'

貢獻者指南