api7 / api7/aisix

e2e: pre-existing `tsc --noEmit` errors in cache-scenarios / request-id-uuid tests

Open Beginner friendly
#527 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority-normal
Dominant language
Rust
Stars
157
Forks
32
Avg merge
1h 25m
Merged PRs (30d)
145

Description

pnpm exec tsc --noEmit in tests/e2e reports 4 pre-existing type errors, unrelated to current feature work. Recording here; not fixing now.

Errors

src/cases/cache-scenarios-e2e.test.ts(96,36): error TS18048: 'app' is possibly 'undefined'.
src/cases/request-id-uuid-e2e.test.ts(124,20): error TS18048: 'app' is possibly 'undefined'.
src/cases/request-id-uuid-e2e.test.ts(128,20): error TS18048: 'app' is possibly 'undefined'.
src/cases/request-id-uuid-e2e.test.ts(132,20): error TS18048: 'app' is possibly 'undefined'.

Notes

  • strictNullChecks narrowing gaps: app (a SpawnedApp | undefined assigned in beforeAll) is used in the test body without a non-null guard. Most other e2e cases gate on if (!app) { ctx.skip(); return; } first.
  • vitest runs via esbuild (no typecheck at runtime), so these do not fail the test run — only tsc --noEmit surfaces them. CI does not currently run tsc --noEmit on the e2e harness.
  • Suggested fix: add the missing if (!etcdReachable || !app) { ctx.skip(); return; } guard (or a local non-null assertion) in those two files.

Surfaced while adding the aliyun_sls exporter e2e (which typechecks clean); deferred by decision.

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 with src/cases/cache-scenarios-e2e.test.ts at line 96 and src/cases/request-id-uuid-e2e.test.ts at lines 124, 128, and 132, then compare their setup with other e2e cases that guard app before use. Run pnpm exec tsc --noEmit from tests/e2e; done means the four TS18048 errors no longer appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.