diff --git a/addon/types/index.d.ts b/addon/types/index.d.ts index c40da7a5..f423733c 100644 --- a/addon/types/index.d.ts +++ b/addon/types/index.d.ts @@ -274,7 +274,7 @@ declare global { interface EachFunction { ( name: string, - dataset: T[], + dataset: T[] | Record, callback: (this: TC, assert: Assert, data: T) => void | Promise ): void; } diff --git a/test-types/src/tests.ts b/test-types/src/tests.ts index 5c8897eb..f28443cd 100644 --- a/test-types/src/tests.ts +++ b/test-types/src/tests.ts @@ -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');