test: add variable system tests and jest config updates

- Add comprehensive tests for variable system, including parsing,
  expression evaluation, and reactivity.
- Add `moduleNameMapper` to `jest.config.js` to resolve `.js` imports
  to `.ts` source files.
- Add a mock for `csv-parse/browser/esm/sync` to support Node-based
  testing.
This commit is contained in:
2026-07-13 11:08:48 +08:00
parent 2c762b0411
commit c106b6f79c
3 changed files with 879 additions and 0 deletions
+4
View File
@@ -4,6 +4,10 @@ export default {
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
moduleNameMapper: {
// Resolve .js imports to .ts source files (ESM convention in TS source)
'^(.+)\\.js$': ['$1.ts', '$1.tsx', '$1.js'],
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',