Skip to main content

Module: testUtil/fromPlainObject

Functions

plainObjectToPosition

plainObjectToPosition(__namedParameters): Position

Parameters

NameType
__namedParametersPositionPlainObject

Returns

Position

Defined in

testUtil/fromPlainObject.ts:41


plainObjectToRange

plainObjectToRange(__namedParameters): Range

Parameters

NameType
__namedParametersRangePlainObject

Returns

Range

Defined in

testUtil/fromPlainObject.ts:48


plainObjectToSelection

plainObjectToSelection(__namedParameters): Selection

Parameters

NameType
__namedParametersSelectionPlainObject

Returns

Selection

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

NameTypeDescription
editorTextEditorThe editor where the target ranges are defined
plainObjectTargetPlainObjectA plain object describing a Target

Returns

Target

A Target constructed from the given plain object

Defined in

testUtil/fromPlainObject.ts:24