foundation-testing
Home > @genesislcap/foundation-testing
foundation-testing package
Functions
Function | Description |
---|---|
createComponentSuite(title, elementNameOrGetter, context, registrations) | Create component test suite. |
createLogicSuite(title, context) | Create logic test suite. |
fixture(templateNameOrRegistry, options) | Creates a test fixture suitable for testing custom elements, templates, and bindings. |
resetTestHarness(wrapper) | Resets the history of the spied functions on the objects so previous running tests don't affect the current test. Must be called at the end of every test even if not asserting on the spies. |
restoreTestHarness(wrapper) | Restores the spied functions back to the original functions without the spies. |
runCases(fn, cases, assertion) | Assert a set of test cases. |
testSpy(constructor) | Decorator: Used on a test harness class based on a FoundationElement to give it extra functionality which can be used during testing. *Important* this is to be used on a parent element compared to the element under test. |
Interfaces
Interface | Description |
---|---|
ComponentContext | Component suite context interface |
Fixture | Unit test fixture. |
FixtureOptions | Options used to customize the creation of the unit test fixture. |
LogicContext | Logic suite context interface |
Variables
Variable | Description |
---|---|
delayedResolve | Delayed resolve utility. |
logger | Test logger |
timeout | Timeout utility. |
Type Aliases
Type Alias | Description |
---|---|
ElementGetter | |
Equal | Expects that the type parameter X is equal to Y, returning true or false |
Expect | Expects that the type parameter T resolves to true, or will be a typescript error |
FilterConditionally | Filters out key/value pairs from an object where they value does not match a condition |
RunCases | |
SinonWrapper | Crates an object with a key value pair for each spied function where the key is the function name and the value is the sinon wrapped spy function |
SpiedFunctions | Filters out all key/value pairs which are not functions, and omits the constructor |
SuiteCallback | Defines the Generic type for a test Suite T the callback function required to assert on type T . |
WithTestHarness | Type can be used to inform Typescript the object decorated with testSpy() has function spies which can be interacted upon their normal function reference |