mirror of
https://github.com/hanzoai/numscript.git
synced 2026-10-30 18:26:57 +00:00
* breaking: change assertion name * feat: add errMissingFunds assertion * breaking: renamed assertion * breaking: renamed assertions * feat: added expect.endBalances.include assertion * feat: better test output * fix * feat: added focus and skip * improve UI for focused/skipped tests * improve test ui
56 lines
1.1 KiB
JSON
56 lines
1.1 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json",
|
|
"variables": {
|
|
"amt": "EUR/2 100",
|
|
"limit": "EUR/2 150"
|
|
},
|
|
"balances": {
|
|
"alice": {
|
|
"EUR/2": 9999
|
|
}
|
|
},
|
|
"testCases": [
|
|
{
|
|
"it": "should send the amount when destination doesn't reach 150",
|
|
"balances": {
|
|
"jon": {
|
|
"EUR/2": 0
|
|
}
|
|
},
|
|
"expect.postings": [
|
|
{
|
|
"source": "alice",
|
|
"destination": "jon",
|
|
"amount": 100,
|
|
"asset": "EUR/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"it": "should send the amount when destination doesn't reach 150 (2)",
|
|
"balances": {
|
|
"jon": {
|
|
"EUR/2": 50
|
|
}
|
|
},
|
|
"expect.postings": [
|
|
{
|
|
"source": "alice",
|
|
"destination": "jon",
|
|
"amount": 100,
|
|
"asset": "EUR/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"it": "should fail if the end balance would exceed 150",
|
|
"balances": {
|
|
"jon": {
|
|
"EUR/2": 51
|
|
}
|
|
},
|
|
"expect.error.missingFunds": true
|
|
}
|
|
]
|
|
}
|