0.4.3 • Published 6 years ago
@chainsafe/eth2.0-spec-test-util v0.4.3
eth2.0-spec-test-util
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
testYamlPathstring path to yaml spec testtestFuncFunction function to use to generate outputgetInputFunction function to convert test case into input array (optional, defaulttestCase=>testCase.input)getExpectedFunction function to convert test case into a comparable expected output (optional, defaulttestCase=>testCase.output)getActualFunction function to convert function output into comparable actual output (optional, defaultresult=>result)shouldErrorFunction function to convert test case into a boolean, if the case should result in an error (optional, default(testCase,index,testSpec)=>false)shouldSkipFunction function to convert test case into a boolean, if the case should be skipped (optional, default(testCase,index,testSpec)=>false)expectFuncFunction 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.