-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest.js
More file actions
155 lines (134 loc) Β· 6.84 KB
/
Copy pathtest.js
File metadata and controls
155 lines (134 loc) Β· 6.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/**
* BirthCode Test Script
* Tests all calculators against known birth data
*/
import calculateNumerology from './src/calculators/numerology.js';
import calculateBiorhythm from './src/calculators/biorhythm.js';
import { calculateSunSign, approximateMoonSign, calculateAstrology } from './src/calculators/astrology.js';
import calculateChinese from './src/calculators/chinese.js';
import calculateMayan from './src/calculators/mayan.js';
import calculateHumanDesign, { calculateGeneKeys } from './src/calculators/humandesign.js';
// Test cases with verified data
const TEST_CASES = [
{
name: "User's Birthday",
birthDate: '1992-09-06',
birthTime: '00:04',
birthHour: 0.0667, // 00:04 AM
timezone: -7, // Pacific Daylight Time
location: { lat: 44.0, lon: -122.5 }, // Vida, OR area
expected: {
lifePath: 9,
sunSign: 'Virgo',
moonSign: 'Capricorn', // Verified from external sources
chineseAnimal: 'Monkey',
chineseElement: 'Water'
}
}
];
function runTests() {
console.log('='.repeat(60));
console.log('BirthCode Calculator Tests');
console.log('='.repeat(60));
console.log('');
for (const testCase of TEST_CASES) {
console.log(`Testing: ${testCase.name}`);
console.log(`Birth: ${testCase.birthDate} ${testCase.birthTime}`);
console.log('-'.repeat(40));
// Numerology
const numerology = calculateNumerology(testCase.birthDate);
console.log(`\nπ NUMEROLOGY:`);
console.log(` Life Path: ${numerology.lifePath} (expected: ${testCase.expected.lifePath})`);
console.log(` ${numerology.lifePath === testCase.expected.lifePath ? 'β
PASS' : 'β FAIL'}`);
console.log(` Type: ${numerology.lifePathMeaning.name}`);
console.log(` Birthday Number: ${numerology.birthdayNumber}`);
console.log(` Personal Year: ${numerology.personalYear}`);
// Biorhythm
const biorhythm = calculateBiorhythm(testCase.birthDate);
console.log(`\nπ BIORHYTHM:`);
console.log(` Days Alive: ${biorhythm.daysAlive}`);
console.log(` Physical: ${Math.round(biorhythm.physical.value * 100)}% (${biorhythm.physical.phase})`);
console.log(` Emotional: ${Math.round(biorhythm.emotional.value * 100)}% (${biorhythm.emotional.phase})`);
console.log(` Intellectual: ${Math.round(biorhythm.intellectual.value * 100)}% (${biorhythm.intellectual.phase})`);
// Astrology (sync version for quick test)
const sunSign = calculateSunSign(testCase.birthDate);
const moonSign = approximateMoonSign(testCase.birthDate);
console.log(`\nβ ASTROLOGY (Sync - Approximate):`);
console.log(` Sun Sign: ${sunSign.name} (expected: ${testCase.expected.sunSign})`);
console.log(` ${sunSign.name === testCase.expected.sunSign ? 'β
PASS' : 'β FAIL'}`);
console.log(` Moon Sign: ${moonSign.sign.name} (expected: ${testCase.expected.moonSign})`);
console.log(` ${moonSign.sign.name === testCase.expected.moonSign ? 'β
PASS' : 'β οΈ APPROXIMATE - needs ephemeris'}`);
console.log(` Element: ${sunSign.element}, Modality: ${sunSign.modality}`);
// Chinese Astrology
const chinese = calculateChinese(testCase.birthDate, testCase.birthHour);
console.log(`\nπ² CHINESE ASTROLOGY:`);
console.log(` Zodiac Animal: ${chinese.zodiacAnimal.emoji} ${chinese.zodiacAnimal.name} (expected: ${testCase.expected.chineseAnimal})`);
console.log(` ${chinese.zodiacAnimal.name === testCase.expected.chineseAnimal ? 'β
PASS' : 'β FAIL'}`);
console.log(` Element: ${chinese.element.primary} (expected: ${testCase.expected.chineseElement})`);
console.log(` ${chinese.element.primary === testCase.expected.chineseElement ? 'β
PASS' : 'β FAIL'}`);
console.log(` Day Master: ${chinese.dayMaster.description}`);
console.log(` BaZi: ${chinese.baziChart.year} ${chinese.baziChart.month} ${chinese.baziChart.day} ${chinese.baziChart.hour}`);
// Mayan Tzolkin
const mayan = calculateMayan(testCase.birthDate);
console.log(`\nπ MAYAN TZOLKIN:`);
console.log(` Kin: ${mayan.kin}`);
console.log(` Day Sign: ${mayan.daySign.glyph} ${mayan.daySign.name}`);
console.log(` Galactic Tone: ${mayan.galacticTone.number} - ${mayan.galacticTone.name}`);
console.log(` Color: ${mayan.daySign.color}`);
console.log(` Wavespell: ${mayan.wavespell.sign.name}`);
console.log('\n' + '='.repeat(60) + '\n');
}
}
// Run full tests with Meeus algorithms
function runFullTests() {
console.log('Running Full Tests (with Meeus Algorithms)...\n');
for (const testCase of TEST_CASES) {
console.log(`Testing: ${testCase.name}`);
console.log('-'.repeat(40));
try {
// Astrology with Meeus
const astrology = calculateAstrology(
testCase.birthDate,
testCase.birthHour,
testCase.timezone,
testCase.location?.lat,
testCase.location?.lon
);
console.log(`\nβ ASTROLOGY (Meeus Algorithms):`);
console.log(` Sun Sign: ${astrology.sun.sign.name} ${astrology.sun.degree || ''}`);
console.log(` Moon Sign: ${astrology.moon.sign.name} ${astrology.moon.degree || ''} (expected: ${testCase.expected.moonSign})`);
console.log(` ${astrology.moon.sign.name === testCase.expected.moonSign ? 'β
PASS' : 'β FAIL'}`);
console.log(` Rising Sign: ${astrology.rising.sign.name}`);
console.log(` Using Meeus: ${astrology.useEphemeris ? 'Yes β' : 'No'}`);
// Human Design with Meeus
const humanDesign = calculateHumanDesign(
testCase.birthDate,
testCase.birthHour,
testCase.timezone
);
console.log(`\nπ· HUMAN DESIGN:`);
console.log(` Type: ${humanDesign.type.name}`);
console.log(` Strategy: ${humanDesign.type.strategy}`);
console.log(` Authority: ${humanDesign.authority.name}`);
console.log(` Profile: ${humanDesign.profile.numbers} ${humanDesign.profile.name}`);
console.log(` Sun Gate: ${humanDesign.gates.personality?.sun?.gate}.${humanDesign.gates.personality?.sun?.line}`);
console.log(` Moon Gate: ${humanDesign.gates.personality?.moon?.gate}.${humanDesign.gates.personality?.moon?.line}`);
console.log(` Incarnation Cross: ${humanDesign.incarnationCross.name}`);
console.log(` Active Gates: ${humanDesign.gates.all?.length || 0}`);
console.log(` Using Meeus: ${humanDesign.useEphemeris ? 'Yes β' : 'No'}`);
const geneKeys = calculateGeneKeys(humanDesign);
console.log(`\n𧬠GENE KEYS:`);
console.log(` Life's Work: Gene Key ${geneKeys.lifeWork.key} - ${geneKeys.lifeWork.name}`);
console.log(` Evolution: Gene Key ${geneKeys.evolution.key} - ${geneKeys.evolution.name}`);
} catch (error) {
console.error(` Error: ${error.message}`);
console.error(error.stack);
}
console.log('\n' + '='.repeat(60) + '\n');
}
}
// Run sync tests first
runTests();
// Then run full tests
runFullTests();
console.log('All tests completed.');