Skip to content

Commit

Permalink
un-mangle the typescript so assert output is more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonatwork committed Feb 28, 2024
1 parent 76edf80 commit 94fb7e8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/Framework/BlackBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ const extractInfo = (originalText: string) => {
};
};

export const toJs = (s: Selection) => ({
active: {
line: s.active.line,
character: s.active.character,
},
anchor: {
line: s.anchor.line,
character: s.anchor.character,
},
});

const reusableDocuments: Map<string, TextDocument> = new Map();

export const run = (testCase: TestCase, before?: (textEditor: TextEditor) => void) => {
Expand Down Expand Up @@ -138,7 +149,7 @@ export const run = (testCase: TestCase, before?: (textEditor: TextEditor) => voi

try {
assert.equal(TestUtil.getDocument()!.getText(), toInfo.cleanText);
assert.deepEqual(TestUtil.getSelections(), toInfo.selections);
assert.deepEqual(TestUtil.getSelections().map(toJs), toInfo.selections.map(toJs));
} catch (error) {
done(error);
return;
Expand Down

0 comments on commit 94fb7e8

Please sign in to comment.