mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
Property ledgerBalanceMatchesTxns asserts displayed balance equals sum(Given) - sum(Received) on either ledger screen. Catches the class of bug where the server-fed CustomerModel.balance diverges from the local-DB-fed CoreDatabaseDao sums (stale cache, partial sync, deleted-txn handling glitch, etc.). Generators are gated by screen state and weighted to push the run through login -> home -> ledger quickly: enterPhone (100), enterOtp (100), openCustomerOrSupplier (80), taps (10), swipes (2). Phone/OTP read from process.env via esbuild defines so credentials never land in source. cmd/internal-tools/bundle-check is a quick sanity tool to confirm the spec bundles before running uatu test.
35 lines
737 B
Go
35 lines
737 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/priyanshujain/uatu/internal/bundler"
|
|
)
|
|
|
|
func main() {
|
|
repoRoot, err := os.Getwd()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "getwd: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
specApiPath := filepath.Join(repoRoot, "pkg/spec-api/src/index.ts")
|
|
|
|
result, err := bundler.Bundle(bundler.Options{
|
|
EntryFile: "examples/specs/merchant-ledger.ts",
|
|
Defines: map[string]string{
|
|
"UATU_TEST_PHONE": "+910000000000",
|
|
"UATU_TEST_OTP": "000000",
|
|
},
|
|
Aliases: map[string]string{
|
|
"@uatu/spec": specApiPath,
|
|
},
|
|
})
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "bundle: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Printf("bundled: %d bytes, sha256=%s\n", len(result.JavaScript), result.SHA256)
|
|
}
|