Skip to content

AVA fails when running test files which are actually symlinks  #1143

Closed
@novemberborn

Description

@novemberborn

Per #1137, if a test pattern matches a symlink, AVA fails to run that test file.

AVA precompiles the test file in the main process. That works fine, even with symlinks. It then communicates a hash for the precompilation result to the worker process. When the test file is required the worker loads it from the precompilation cache, using the hash received from the main process.

The problem is that the hash mapping is for the symlink path, but the worker sees the resolved path instead.

This is where the worker looks up the hash:

const precompiled = opts.precompiled[filename];

This is where the precompiled hash mapping is prepared:

ava/api.js

Line 70 in 0f04001

precompiled[file] = hash;

Probably the best fix is to use fs.realpathSync when preparing the hash mapping in api.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions