kentcdodds / kentcdodds/kcd-scripts

[pre-commit] Fails when passing environment to test script

Open
#105 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
889
Forks
205
PR merge metrics
No merged PRs in 30d

Description

When having your test script with a set environment (--env=jsdom) as we have with geniejs, the pre-commit script will fail as this will run kcd-scripts test --findRelatedTests and doesn't take these extra variables into account

"test": "kcd-scripts test --env=jsdom",

https://github.com/kentcdodds/genie/blob/b2aec0a8ea9bf1a0d85fead0427dcb1a1dcee7c8/package.json#L26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/config/lintstagedrc.js at the linked command that runs kcd-scripts test --findRelatedTests, then compare it with the test script in the referenced package.json. Reproduce the pre-commit failure with a test script using --env=jsdom; done means the extra test environment option is respected when pre-commit runs related tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.