.agent/skills/unit-testing/SKILL.md
Tests are *.spec.ts files colocated with the source they cover, written with Vitest and run per package through Nx. See WritingUnitTests.md for the full guide.
npx nx run core:test # all core tests
npx nx run core:test -t 'Name' # isolate by describe/it name
npx nx run core:test --watch # watch mode
Use -t to run only the tests related to your change first; run the full package target before finishing.
describe, it, expect, beforeEach, vi). Globals are enabled, so imports from vitest are optional — match the style of neighboring specs.packages/core/xml/index.spec.ts covers packages/core/xml/index.ts.packages/core/vitest.setup.ts stubs the platform globals (__IOS__, __ANDROID__, minimal NSObject-style mocks) so modules can load — real iOS/Android APIs do NOT exist here.vitest.setup.ts; do not stub natives inline per spec.apps/automated e2e suite, which requires a simulator/emulator. Do not attempt to run it unless explicitly asked.vi.useFakeTimers()).