mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-13 12:33:07 +02:00
- Add Jest configuration for server-side TypeScript tests - Add tests for extractKeysendMessage function in LND invoices controller - Tests cover keysend message extraction from htlc custom_records - Tests verify the PR fix for returning memo when no keysend message exists - Add tests for CommonService utility functions - maskPasswords: password field masking - convertTimeToEpoch/convertTimestampToTime: time conversion - sortAscByKey/sortDescByKey: array sorting utilities - titleCase/camelCase: string formatting - isVersionCompatible: version comparison - getRequestIP: IP extraction from request - getMonthDays: calendar utilities - Add npm scripts: test:server and test:server:coverage Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: shahana-farooqui <shahana.farooqui@gmail.com>
30 lines
729 B
JavaScript
30 lines
729 B
JavaScript
/** @type {import('jest').Config} */
|
|
module.exports = {
|
|
preset: 'ts-jest/presets/default-esm',
|
|
testEnvironment: 'node',
|
|
roots: ['<rootDir>/server'],
|
|
testMatch: ['**/*.spec.ts'],
|
|
moduleNameMapper: {
|
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
},
|
|
transform: {
|
|
'^.+\\.tsx?$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
tsconfig: 'server/tsconfig.test.json',
|
|
},
|
|
],
|
|
},
|
|
extensionsToTreatAsEsm: ['.ts'],
|
|
collectCoverageFrom: [
|
|
'server/**/*.ts',
|
|
'!server/**/*.spec.ts',
|
|
'!server/models/**',
|
|
],
|
|
coverageDirectory: 'coverage/server',
|
|
coverageReporters: ['text', 'lcov'],
|
|
moduleFileExtensions: ['ts', 'js', 'json'],
|
|
testPathIgnorePatterns: ['/node_modules/'],
|
|
verbose: true,
|
|
};
|