factory-girl
factory-girl copied to clipboard
ENHANCEMENT: Async buildOptions on extended factory not taking the base factory values
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.
Thank you for this note!