Skip to content

Commit

Permalink
delete old helper
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik committed Oct 30, 2024
1 parent 698051f commit bf05722
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/test/suite/participant/participant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2171,24 +2171,10 @@ Schema:

expect(messages).to.have.lengthOf(4);

// VSCode's messages' content could either be array of values or a string
// This helper supports both.
const contentIncludes = (message: any, pattern: string): boolean => {
if (Array.isArray(message.content)) {
return message.content.find((sub: { value: string }) =>
sub.value.includes(pattern)
);
}
if (message.content instanceof String) {
return message.content.includes(pattern);
}
throw new Error(`Unhandled message content type ${message}`);
};

const messageContents = messages.map((message) => {
// There may be different types for the messages' content
const content = Array.isArray(message.content)
? message.content.flatMap((sub) => sub.value).join('')
? message.content.map((sub) => sub.value).join('')
: message.content;

return content;
Expand Down

0 comments on commit bf05722

Please sign in to comment.