Testing
Unit Tests
Test schemas, encoding, and address utilities
Unit Tests
Unit tests validate individual modules — schema encoding/decoding, address parsing, asset manipulation — without needing a blockchain connection.
Testing Schema Round-Trips
import { , , } from "vitest"
import { , , } from "@evolution-sdk/evolution"
const = .({
: .,
: .
})
const = .()
("MyDatum", () => {
("should round-trip encode/decode", () => {
const = {
: 5000000n,
: .("abc123def456abc123def456abc123def456abc123def456abc123de")
}
const = .()
const = .()
(.).(.)
(.).(.)
})
})Testing Address Parsing
import { , , } from "vitest"
import { } from "@evolution-sdk/evolution"
("Address", () => {
("should parse and round-trip bech32", () => {
const = "addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"
const = .()
const = .()
const = .()
const = .()
().()
})
})Testing Assets
import { , , } from "vitest"
import { } from "@evolution-sdk/evolution"
("Assets", () => {
("should merge asset bundles", () => {
const = .(5_000_000n)
const = .(3_000_000n)
const = .(, )
(.).(8_000_000n)
})
})Next Steps
- Integration Tests — Test full transaction workflows
- Emulator — Use devnet for testing