diff --git a/CHANGELOG.md b/CHANGELOG.md index 82fa07a9290d..72b2a46da94f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#6391](https://github.com/facebook/jest/pull/6391)) - `[expect]` `toEqual` no longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties. ([#6398](https://github.com/facebook/jest/pull/6398)) +### Chore & Maintenance + +- `[docs]` Add jest-each docs for 1 dimensional arrays ([#6444](https://github.com/facebook/jest/pull/6444/files)) + ## 23.1.0 ### Features diff --git a/docs/GlobalAPI.md b/docs/GlobalAPI.md index 049cf3ec692f..55e8c08c369c 100644 --- a/docs/GlobalAPI.md +++ b/docs/GlobalAPI.md @@ -231,6 +231,7 @@ Use `describe.each` if you keep duplicating the same test suites with different #### 1. `describe.each(table)(name, fn)` - `table`: `Array` of Arrays with the arguments that are passed into the `fn` for each row. + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` - `name`: `String` the title of the test suite. - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). @@ -476,6 +477,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test #### 1. `test.each(table)(name, fn)` - `table`: `Array` of Arrays with the arguments that are passed into the test `fn` for each row. + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` - `name`: `String` the title of the test block. - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). diff --git a/packages/jest-each/README.md b/packages/jest-each/README.md index 08b2994837f5..d932cbaac14b 100644 --- a/packages/jest-each/README.md +++ b/packages/jest-each/README.md @@ -96,6 +96,7 @@ const each = require('jest-each'); ##### `each`: - parameters: `Array` of Arrays with the arguments that are passed into the `testFn` for each row + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` ##### `.test`: @@ -116,6 +117,7 @@ const each = require('jest-each'); ##### `each`: - parameters: `Array` of Arrays with the arguments that are passed into the `suiteFn` for each row + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` ##### `.describe`: