Skip to content

Commit d59c6f3

Browse files
author
Ben Lichtman
committed
Make unchecked property assertion optional
1 parent 509d243 commit d59c6f3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/harness/fourslashImpl.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,14 @@ namespace FourSlash {
867867
}
868868
}
869869

870+
if (isFromUncheckedFile !== undefined) {
871+
if (actual.isFromUncheckedFile !== isFromUncheckedFile) {
872+
this.raiseError(`Expected 'isFromUncheckedFile' value '${actual.isFromUncheckedFile}' to equal '${isFromUncheckedFile}'`);
873+
}
874+
}
875+
870876
assert.equal(actual.hasAction, hasAction, `Expected 'hasAction' value '${actual.hasAction}' to equal '${hasAction}'`);
871877
assert.equal(actual.isRecommended, isRecommended, `Expected 'isRecommended' value '${actual.isRecommended}' to equal '${isRecommended}'`);
872-
assert.equal(actual.isFromUncheckedFile, isFromUncheckedFile, `Expected 'isFromUncheckedFile' value '${actual.isFromUncheckedFile}' to equal '${isFromUncheckedFile}'`);
873878
assert.equal(actual.source, source, `Expected 'source' value '${actual.source}' to equal '${source}'`);
874879
assert.equal(actual.sortText, sortText || ts.Completions.SortText.LocationPriority, this.messageAtLastKnownMarker(`Actual entry: ${JSON.stringify(actual)}`));
875880

src/harness/fourslashInterfaceImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ namespace FourSlashInterface {
14721472
readonly replacementSpan?: FourSlash.Range;
14731473
readonly hasAction?: boolean; // If not specified, will assert that this is false.
14741474
readonly isRecommended?: boolean; // If not specified, will assert that this is false.
1475-
readonly isFromUncheckedFile?: boolean; // If not specified, will assert that this is false.
1475+
readonly isFromUncheckedFile?: boolean; // If not specified, won't assert about this
14761476
readonly kind?: string; // If not specified, won't assert about this
14771477
readonly kindModifiers?: string; // Must be paired with 'kind'
14781478
readonly text?: string;

0 commit comments

Comments
 (0)