factory-girl icon indicating copy to clipboard operation
factory-girl copied to clipboard

ENHANCEMENT: Async buildOptions on extended factory not taking the base factory values

Open zveljkovic opened this issue 6 years ago • 1 comments

If original factory has async function with buildOptions parameter any factory extending from it will not pick up original attributes.

  factory.define("orig", BasketModel, async (buildOptions = {}) => {
    return {storeId: 1};
  });
  factory.extend("basket", "basketPayed", {
    closed: 66
  });

It works properly if the async part is moved to afterBuild for anyone looking for same issue.

zveljkovic avatar Aug 05 '18 12:08 zveljkovic

Thank you for this note!

stewartjarod avatar Dec 20 '19 21:12 stewartjarod