Skip to content

add SHOPIFY_CLI_ENV=development for dev test#6998

Open
phyllis-sy-wu wants to merge 1 commit intomainfrom
psyw-0312-add-SHOPIFY_CLI_ENV_development-for-dev-test
Open

add SHOPIFY_CLI_ENV=development for dev test#6998
phyllis-sy-wu wants to merge 1 commit intomainfrom
psyw-0312-add-SHOPIFY_CLI_ENV_development-for-dev-test

Conversation

@phyllis-sy-wu
Copy link
Contributor

@phyllis-sy-wu phyllis-sy-wu commented Mar 12, 2026

WHY are these changes introduced?

The unit test script needs to run with the development environment configuration to ensure proper test execution and behavior.

Relevant issues: https://shopify.slack.com/archives/C05E3BDFDRB/p1773343132505319

WHAT is this pull request doing?

Sets the SHOPIFY_CLI_ENV=development environment variable for the test:unit npm script to ensure unit tests run in the correct environment context.

How to test your changes?

  1. Run dev test and verify that all tests execute successfully
  2. Remove the SHOPIFY_CLI_ENV=development and run dev test to observe the failure in four tests.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@phyllis-sy-wu phyllis-sy-wu marked this pull request as ready for review March 12, 2026 22:46
@phyllis-sy-wu phyllis-sy-wu requested a review from a team as a code owner March 12, 2026 22:46
@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 77.22% 14548/18839
🟡 Branches 70.91% 7217/10178
🟡 Functions 76.2% 3698/4853
🟡 Lines 78.72% 13753/17471

Test suite run success

3806 tests passing in 1462 suites.

Report generated by 🧪jest coverage report action from 13bbcda

"test:regenerate-snapshots": "nx build cli && packages/features/snapshots/regenerate.sh",
"test:unit": "pnpm vitest run",
"test:unit": "SHOPIFY_CLI_ENV=development pnpm vitest run",
"test": "pnpm vitest run && pnpm nx run features:test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also be here

Copy link
Contributor

@ryancbahan ryancbahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job! let's just make sure all the package.json commands that need this env var have it

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

Successfully merging this pull request may close these issues.

2 participants