You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/testing.mdc
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,11 @@ alwaysApply: false
26
26
27
27
## Credentials & env (sanity only)
28
28
29
-
- Sanity tests need env vars documented in **`test/sanity-check/utility/testSetup.js`** (`EMAIL`, `PASSWORD`, `HOST`, `ORGANIZATION`, optional OAuth/Personalize). **Do not** commit secrets or hardcode tokens in tests.
29
+
- Canonical env documentation: **`test/sanity-check/utility/testSetup.js`** (see also `sanity.js`).
30
+
- **Required for setup:** `EMAIL`, `PASSWORD`, `HOST`, `ORGANIZATION`.
Copy file name to clipboardExpand all lines: skills/testing/SKILL.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,36 @@ Always **`npm run build`** before sanity if `dist/node/contentstack-management.j
28
28
## Sanity tests (`test/sanity-check/`)
29
29
30
30
-**Live** Contentstack CMA calls; orchestrated by `test/sanity-check/sanity.js`.
31
-
-**Env**: required variables and optional OAuth/Personalize keys are listed at the top of **`test/sanity-check/utility/testSetup.js`** (e.g. `EMAIL`, `PASSWORD`, `HOST`, `ORGANIZATION`).
32
-
-**Flow**: setup creates stack/management token/fixtures where applicable; teardown is handled in the same module — read it before adding destructive tests.
31
+
-**Authoritative list:** variable names and defaults are documented in **`test/sanity-check/utility/testSetup.js`** (and mirrored in `sanity.js`); prefer that file when adding new env vars.
32
+
33
+
### Environment variables
34
+
35
+
**Required (core)** — setup fails or cannot run without these:
36
+
37
+
-`EMAIL`, `PASSWORD`, `HOST`, `ORGANIZATION`
38
+
39
+
Without them, login / stack creation / org-scoped setup does not complete.
40
+
41
+
**Required for specific suites** — related tests **skip** (or degrade) when missing:
42
+
43
+
| Area | Variables | Notes |
44
+
|------|-----------|--------|
45
+
|**OAuth**|`CLIENT_ID`, `APP_ID`, `REDIRECT_URI`| Used by `oauth-test.js` and auth flows that need app registration |
46
+
|**2FA (TFA)**|`TFA_EMAIL`, `TFA_PASSWORD`|`user-test.js` — skip TFA scenarios when unset |
47
+
|**MFA (TOTP)**|`MFA_SECRET`|`user-test.js` — MFA login path; optional asserts still run without it in some cases |
48
+
|**Team / stack share**|`MEMBER_EMAIL`|`team-test.js`, `stack-test.js` — avoids mutating the admin user; share tests skip if unset |
49
+
|**DAM 2.0**|`DAM_2_0_ENABLED=true`|`entry-test.js` — asset/DAM 2.0 block gated on this flag |
50
+
51
+
**Optional / config** (defaults exist; override when needed):
52
+
53
+
-`PERSONALIZE_HOST` — defaults to `personalize-api.contentstack.com` in setup
54
+
-`DELETE_DYNAMIC_RESOURCES` — defaults to deleting dynamic stack/Personalize resources; set to `false` to keep them for debugging
55
+
56
+
**Regions / hosts:** point `HOST` at the **API host** for the stack you are testing (e.g. regional or custom CMA host), consistent with `testSetup.js`.
57
+
58
+
**Runtime (not for .env check-in):** after setup, `testSetup` assigns `process.env.API_KEY`, `AUTHTOKEN`, `MANAGEMENT_TOKEN`, `PERSONALIZE_PROJECT_UID`, etc. Do not commit those; they are produced by the harness.
59
+
60
+
-**Flow**: setup creates stack, management token, and Personalize project where applicable; teardown reads `DELETE_DYNAMIC_RESOURCES`. Read **`testSetup.js`** before adding destructive or org-wide tests.
0 commit comments