
(table)(name, fn, timeout) Īlso under the alias: it.concurrent.each(table)(name, fn, timeout) Use the maxConcurrency configuration option to prevent Jest from executing more than the specified amount of tests at the same time.

Optionally, you can provide a timeout (in milliseconds) for specifying how long to wait for each row before aborting. You cannot use $variable with the printf formatting except for %%įn: Function the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments.You can use $# to inject the index of the test case.To inject nested object values use you can supply a keyPath i.e.Or generate unique test titles by injecting properties of test case object with $variable.Generate unique test titles by positionally injecting parameters with printf formatting:.Name: String the title of the test suite. If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. Table: Array of Arrays with the arguments that are passed into the fn for each row. describe.each(table)(name, fn, timeout) describe.each allows you to write the test suite once and pass data in.ĭescribe.each is available with two APIs: 1. Use describe.each if you keep duplicating the same test suites with different data. This is often useful if you want to clean up some global setup state that is shared across tests.ĭescribe.each(table)(name, fn, timeout)

Optionally, you can provide a timeout (in milliseconds) for specifying how long to wait before aborting. If the function returns a promise or is a generator, Jest waits for that promise to resolve before continuing. Runs a function after all the tests in this file have completed.

