MCPcopy Index your code
hub / github.com/react/react / expectPosition

Function expectPosition

packages/react-dom/src/__tests__/ReactDOMFragmentRefs-test.js:1174–1185  ·  view source on GitHub ↗
(position, spec)

Source from the content-addressed store, hash-verified

1172
1173 describe('compareDocumentPosition', () => {
1174 function expectPosition(position, spec) {
1175 const positionResult = {
1176 following: (position & Node.DOCUMENT_POSITION_FOLLOWING) !== 0,
1177 preceding: (position & Node.DOCUMENT_POSITION_PRECEDING) !== 0,
1178 contains: (position & Node.DOCUMENT_POSITION_CONTAINS) !== 0,
1179 containedBy: (position & Node.DOCUMENT_POSITION_CONTAINED_BY) !== 0,
1180 disconnected: (position & Node.DOCUMENT_POSITION_DISCONNECTED) !== 0,
1181 implementationSpecific:
1182 (position & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC) !== 0,
1183 };
1184 expect(positionResult).toEqual(spec);
1185 }
1186 // @gate enableFragmentRefs
1187 it('returns the relationship between the fragment instance and a given node', async () => {
1188 const fragmentRef = React.createRef();

Callers 1

Calls 1

toEqualMethod · 0.65

Tested by

no test coverage detected