pentf
    Preparing search index...

    Function expectedToFail

    • Mark a code section as expected to fail. If the async function throws an error, the error will be included in reports, but not counted as a test failure. If the async function succeeds, a warning will be printed.

      Parameters

      • config: any

        The pentf configuration.

      • message: string

        Error message to show when the section fails (recommended: ticket URL)

      • asyncFunc: () => any

        The asynchronous section which is part of the test.

      • expectNothing: { expectNothing?: boolean } = {}

        Do nothing – this is convenient if the code is expected to work on some environments. (default: false)

      Returns Promise<void>

      await expectedToFail(config, 'BUG-1234', async() => {
      ...
      }, {
      expectNothing: config.env === 'very-good-environment',
      });