Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ declare global {
interface EachFunction {
<TC extends TestContext, T>(
name: string,
dataset: T[],
dataset: T[] | Record<string, T>,
callback: (this: TC, assert: Assert, data: T) => void | Promise<unknown>
): void;
}
Expand Down
11 changes: 10 additions & 1 deletion test-types/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,16 @@ module('with setup options', function(hooks) {
});

module('methods on test function', function() {
test.each('example with each', [1, 2, 3], async function(assert, number) {
test.each('example with each (array dataset)', [1, 2, 3], async function(assert, number) {
// setup the outer context
this.set('value', 'cat');

await render(hbs`{{number}}`);

assert.strictEqual(number, 1)
});

test.each('example with each (object dataset)', { one: 1, two: 2, three: 3 }, async function(assert, number) {
// setup the outer context
this.set('value', 'cat');

Expand Down
Loading