TypeScript/tests/cases/fourslash/referencesForObjectLiteralProperties.ts
Andy Hanson 8515f7e2b5 Change find-all-references tests to test for groups
* Also always test for isWriteAccess and isDefinition
2017-01-31 06:59:16 -08:00

18 lines
567 B
TypeScript

/// <reference path='fourslash.ts'/>
// References to an object literal property
////var x = { [|{| "isWriteAccess": true, "isDefinition": true |}add|]: 0, b: "string" };
////x["[|add|]"];
////x.[|add|];
////var y = x;
////y.[|add|];
const ranges = test.ranges();
const [r0, r1, r2, r3] = ranges;
verify.referenceGroups(r0, [{ definition: "(property) add: number", ranges }]);
verify.referenceGroups([r1, r2, r3], [
{ definition: "(property) add: number", ranges: [r0] },
{ definition: "(property) add: number", ranges: [r1, r2, r3] }
]);