import { expect , use } from "chai" ; import { XMLAttribute , XMLElement } from "@xml-tools/ast" ; import { UI5XMLViewCompletion } from "@ui5-language-assistant/xml-views-completion" ; import { map } from "lodash" ; import deepEqualInAnyOrder = require ( "deep-equal-in-any-order" ) ; use ( deepEqualInAnyOrder ) ; export function expectUnsortedEquality ( actual , expected ) { expect ( actual ) . to . deep . equalInAnyOrder ( expected ) ; } export function expectXMLAttribute ( astNode ) { expect ( astNode . type ) . to . equal ( "XMLAttribute" ) ; } export function expectExists ( value , message ) { expect ( value , message ) . to . exist ; } export function expectProperty < T > ( value , property , message ) { expect ( value , message ) . to . haveOwnProperty ( property ) ; } export function expectSuggestions ( actualNameGetter , suggestions , expected ) { const suggestedNames = map ( suggestions , actualNameGetter ) ; expectUnsortedEquality ( suggestedNames , expected ) ; }