Trường · Maybe

Trường · Maybe · helpers.maybe. Phương thức tạo · Ví dụ

helpers.maybe

Cài đặt trình tạo

Tạo dữ liệu để xem kết quả ở đây.

Tham số & Ví dụ

Returns the result of the callback if the probability check was successful, otherwise undefined.

helpers.maybe(callback: () => TResult, options?: { probability? })
callback
The callback that will be invoked if the probability check was successful.
options
The options to use.
options.probability
The probability ([0.00, 1.00]) of the callback being invoked. Defaults to 0.5.

Ví dụ

null

Dùng dữ liệu tổng hợp trong môi trường kiểm thử.

Trình tạo liên quan

Khám phá kịch bản