Skip to content

Option to configure the timezone in the main process #3027

Open
@novemberborn

Description

@novemberborn

AVA lets you specify environment variables. These are used when starting the worker threads or child processes to run the test files. However when using worker threads, you cannot set the timezone for a specific thread. AVA doesn't officially let you modify the environment of the main process either.

Some options:

  • You can set TZ=Etc/UTC npx ava but then you need to always invoke AVA that way
  • You can actually modify the environment, from ava.config.* files; but this is not officially part of the configuration API. Still, it could suffice for now
  • We could add a mergeEnvironment() interface to the configuration API to make the above officially supported
  • We could detect the TZ environment variable and apply it to the main process, which goes against AVA's mantra of not magically modifying the test environment
  • We could add a separate "main process environment variables" configuration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions