Module: testUtil/fromPlainObject
Functions
plainObjectToPosition
▸ plainObjectToPosition(__namedParameters): Position
Parameters
| Name | Type |
|---|---|
__namedParameters | PositionPlainObject |
Returns
Defined in
testUtil/fromPlainObject.ts:41
plainObjectToRange
▸ plainObjectToRange(__namedParameters): Range
Parameters
| Name | Type |
|---|---|
__namedParameters | RangePlainObject |
Returns
Defined in
testUtil/fromPlainObject.ts:48
plainObjectToSelection
▸ plainObjectToSelection(__namedParameters): Selection
Parameters
| Name | Type |
|---|---|
__namedParameters | SelectionPlainObject |
Returns
Defined in
testUtil/fromPlainObject.ts:52
plainObjectToTarget
▸ plainObjectToTarget(editor, plainObject): Target
Given a plain object describing a target, constructs a Target object.
Note that the target object today doesn't include a reference to an editor,
because all of our recorded tests are on single editors, so we just construct
a target where the ranges refer to {@link editor}.
Note that this function is just a partial implementation today, throwing an
exception if we try to rehydrate anything other than an UntypedTarget.
Parameters
| Name | Type | Description |
|---|---|---|
editor | TextEditor | The editor where the target ranges are defined |
plainObject | TargetPlainObject | A plain object describing a Target |
Returns
A Target constructed from the given plain object
Defined in
testUtil/fromPlainObject.ts:24