Package Exports
- @chainsafe/lodestar-spec-test-util
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chainsafe/lodestar-spec-test-util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lodestar-spec-test-util
This package is part of ChainSafe's Lodestar project
Mocha / Chai utility for interacting with eth2.0 spec tests
API
describeSpecTest
Run yaml Eth2.0 spec tests for a certain function Compares actual vs expected for all test cases
Parameters
testYamlPath
string path to yaml spec testtestFunc
Function function to use to generate outputgetInput
Function function to convert test case into input array (optional, defaulttestCase=>testCase.input
)getExpected
Function function to convert test case into a comparable expected output (optional, defaulttestCase=>testCase.output
)getActual
Function function to convert function output into comparable actual output (optional, defaultresult=>result
)shouldError
Function function to convert test case into a boolean, if the case should result in an error (optional, default(testCase,index,testSpec)=>false
)shouldSkip
Function function to convert test case into a boolean, if the case should be skipped (optional, default(testCase,index,testSpec)=>false
)expectFunc
Function function to run expectations against expected and actual output (optional, default(testCase,expect,expected,actual)=>expect(actual).to.be.equal(expected)
)
Profiling
Set env variable GEN_PROFILE_DIR with path to directory where you wish your cpu profiles to be generated.
License
Apache-2.0 ChainSafe Systems