Function WorldCreator

  • Define a custom world creator and (optional) destroyer. These will be use to create and destroy each World instance. Both functions can either return a value, or promise that resolves to a value.

    Parameters

    • creator: () => any

      A function that creates and returns a custom World object

    • Optionaldestroyer: (world: any) => Promisable<void>

      An optional function to clean up the World object after each test case

    Returns void

    CustomWorld(async () => {
    return { myCustomProperty: 'value' }
    }, async (world) => {
    // cleanup resources
    })