Repository navigation
Make npm test run the TypeScript suite with Vitest - #134
Merged
memplethee-lab merged 6 commits intoOct 12, 2026
Merged
Conversation
package.json ran "node --test src/**/*.test.ts", which cannot work: Node 20 has no TypeScript loader, the glob relies on shell expansion (so it behaves differently on Windows/CI shells), and the test file's imports use extensions/aliases Node's resolver rejects. - Add vitest as a dev dependency - "npm test" now runs "vitest run" (and "test:watch" for local dev) - Add vitest.config.ts, including the "@/*" alias from tsconfig.json so tests resolve modules the same way the app does Refs LintError#18
- Import test/describe/beforeEach/afterEach from "vitest" instead of "node:test"; node:assert assertions are unchanged and still work - Import the unit under test via "@/src/utils/stellar" to exercise the path alias resolution required by the issue Refs LintError#18
The test job ran "npm run build", which builds the app but never executes a single test, so coverage and correctness could regress silently. Run "npm test" instead so CI fails when the suite fails. Closes LintError#18
Add a Testing section to CONTRIBUTING.md covering "npm test", "npm run test:watch" and the "@/" alias used by tests. Refs LintError#18
"npm ci" failed in CI because package.json declared vitest but the lock file had no entry for it. Regenerated with "npm install --package-lock-only". The change is additive: 83 packages added, none changed or removed. Refs LintError#18
The sendXLM "submits the signed transaction" test assumed
payment.destination.accountId() and payment.amount === '2.5'. With
@stellar/stellar-sdk 12.x the operation destination is the plain
G-address string and amount is normalized to 7 decimals ("2.5000000"),
so both assertions failed now that "npm test" actually runs.
Accept either the string or an Account for destination, and compare the
amount numerically.
Refs LintError#18
guptakumarranjeet150
pushed a commit
to guptakumarranjeet150/orionpay-UI
that referenced
this pull request
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
npm testactually run the TypeScript suite (Vitest)Summary
Fixes #18.
package.jsonrannode --test src/**/*.test.ts, which could never work:node --testcannot execute.tsfiles.src/**/*.test.tsglob depended on shell expansion, so it behaved differently (or broke) on Windows/CI shells.CI's
testjob only rannpm run build, so the suite never executed and regressions went unnoticed.Changes
package.json- addvitest;testnow runsvitest run, plus atest:watchscript.package-lock.json- regenerated sonpm cistays in sync (additive: 83 packages added, none changed or removed).vitest.config.ts(new) - node environment,src/**/*.test.tsinclude, and the@/*->./*alias mirrored fromtsconfig.json.src/utils/stellar.test.ts- importtest/describe/beforeEach/afterEachfromvitest(assertions stay onnode:assert), and import the unit under test via@/src/utils/stellarto prove alias resolution..github/workflows/ci.yml- thetestjob now runsnpm testinstead of just building.CONTRIBUTING.md- document how to run the suite.Acceptance criteria
npm testruns the existing stellar tests (via Vitest)@/src/...path alias resolves in tests (exercised by the import instellar.test.ts)Notes
npm ci --dry-runresolves cleanly. No production code changed.Closes #18