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

Using computable names in the jest describe/it results in Jest Runner not picking up the test #370

Open
MattBidewell opened this issue Aug 20, 2024 · 0 comments

Comments

@MattBidewell
Copy link

MattBidewell commented Aug 20, 2024

(could be more of a feature enhancement rather than a bug)

👋🏻 hey folks!

Found a scenario where using the computed name of path.basename(__filename) will result in the test being skipped due to it not be found when running run.

Example:

import path from 'path';

describe(path.basename(__filename), () => {
  it('doesnt execute', () => {
    expect(true).toBe(true);
  });
});

describe('does work', () => {
  it('does execute', () => {
    expect(true).toBe(true);
  })
})

Repo with example: https://github.com/MattBidewell/jest-runner-name-bug

When running run above the test using the computed describe name:
image

When running run above the standard describe name:
image

I suspect we might need to potentially do a replace on the name value before we execute the command in the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant