Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add per-task untimed lifecycle hooks #33

Merged
merged 6 commits into from
Mar 4, 2023

Commits on Feb 21, 2023

  1. feat: add per-task untimed lifecycle hooks

    Adds four lifecycle hooks that can be configured to run on a per-task
    basis without impacting the test timings:
    
    - `before`: run once before iterations of the task start
    - `beforeEach`: run before each iteration of the task
    - `afterEach`: run after each iteration of the task
    - `after`: run after all iterations finish
    
    A contrived example:
    
    ```js
    suite.add('my task', async () => {
      // the timed function
    }, {
      before: () => {
        // start a server
      },
      beforeEach: () => {
        // set up some data that the timed function will mutate
      },
      afterEach: () => {
        // tear down any mutated data
      },
      after: () => {
        // stop the server
      }
    })
    ```
    
    This is useful if, for example, you are testing several implementations
    of the same functionality and need to perform different operations on
    each implementation to bring them into the same state that the timing
    data from the task function is useful data.
    achingbrain committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    30fb099 View commit details
    Browse the repository at this point in the history
  2. undo whitespace change

    achingbrain committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    fd3ac33 View commit details
    Browse the repository at this point in the history
  3. undo whitespace change

    achingbrain committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    7a9fe80 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2023

  1. chore: update lockfile

    achingbrain committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    ed95420 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba44c2e View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2023

  1. small updates

    Aslemammad committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    054e5c7 View commit details
    Browse the repository at this point in the history