Skip to content

[FR]: Default cacheDirectory to TEST_TMPDIR #230

@sallustfire

Description

@sallustfire

What is the current behavior?

Jest provides a config option cacheDirectory which specifies where intermediate file system outputs are written such as transformations or haste map. If left unspecified, the default is approximately ${os.tmpdir()}/jest_${process.uid}. The contents of this directory are not deleted when jest exits and files are written even when --no-cache is set.

Describe the feature

Bazel's TEST_TMPDIR should be integrated to set the jest cacheDirectory in the generated configuration.

  • TEST_TMPDIR in Bazel is available to every test action as an ENV. The directory is writable, guaranteed to be empty, and unique to a given test target.
  • This enforces hermeticity at the file system level between different jest_test targets and brings rules_jest more in line with the bazel test specification.
  • TEST_TMPDIR can either be provided via CLI flag via "make variable" expansion or set in the generated config template by reading from process.env.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions