Commit dbeb75a
refactor(tests): transpile TS test suite to ReScript
Converts all six TypeScript test files under tests/ to ReScript per the
hyperpolymath language policy ("No new TypeScript files — Convert
existing TS to ReScript"). The extension runtime is untouched: TS was
only in tests/ and never shipped in the XPI (verified by unzipping
fireflag-0.1.0.zip before the change).
Files:
tests/Bindings.res — Deno.test / std/assert bindings
tests/unit/TypesTest.res — 23 tests (was types_test.ts)
tests/unit/FlagEvaluationTest.res — 19 tests
tests/property/FlagPropertiesTest.res — 18 tests
tests/aspect/SecurityTest.res — 21 tests
tests/e2e/ExtensionLifecycleTest.res — 13 tests
tests/bench/FlagBench.res — 26 benchmarks
Wire-up:
rescript.json — tests/ added as a "dev" source subdir
deno.json — added @rescript/runtime esm.sh mapping; test tasks
now point at the compiled *.res.js outputs; --no-check
bypasses the ReScript runtime's TS-from-d.ts resolution
(which Deno's type-checker doesn't understand)
.gitignore — ignore *.cmj / *.ast, and the lib/ocaml/*.res mirror
the rescript compiler maintains as a cache (the four
historically-tracked files are explicitly kept)
Verification:
deno task test → 94 passed | 0 failed (611ms)
deno task test:bench → all 26 benchmarks run
Semantic parity with the original TS suite was the only acceptance
criterion. Heterogeneous flag values (TS `unknown`) are modelled as an
abstract type with identity coercions (toU / fromU) — zero runtime cost.
TS classes (FireflagExtension) become mutable records + top-level
functions. The `effects`/`caps`/`loc` exclusions we applied in the
typed-wasm ECHIDNA erasure test (sibling repo) are not relevant here;
fireflag tests exercise behaviour, not proof erasure.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 86ee226 commit dbeb75a
23 files changed
Lines changed: 5773 additions & 3036 deletions
File tree
- tests
- aspect
- bench
- e2e
- property
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments