Commit 17e7ce6
committed
Fix broken flight axis override tests
The test_flight_axis_override.js file had multiple bugs preventing tests
from running correctly:
**Fix #1: Missing Decompiler import**
- Added `import { Decompiler } from '../decompiler.js';`
- Changed `transpiler.decompile()` to proper `new Decompiler()` usage
- Error was: "transpiler.decompile is not a function"
**Fix #2: Invalid property name in Test 4**
- Fixed `flight.armed` → `flight.isArmed`
- Error was: "Unknown property 'armed' in 'flight.armed'"
- The correct property is `isArmed` per the flight API
**Fix #3: Error message handling**
- Fixed `result.errors` → `result.error || result.errors`
- Fixed `decompiled.errors` → `decompiled.error || decompiled.errors`
- Handles both singular and plural error field names
**Test Results:**
Before: 3 decompile errors, 1 compilation failure
After: All 4 tests pass ✅
- Test 1: Roll angle override ✅
- Test 2: Pitch rate override ✅
- Test 3: Yaw angle override ✅
- Test 4: Multiple axis overrides ✅1 parent 61c8ab1 commit 17e7ce6
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | | - | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
0 commit comments