You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test currently creates its own location structure and asserts that it ends up in the resulting node.
It currently passes because of its parameters being any. However, if we strongly type those, the test fails to compile.
This is because during the TS conversion, we introduced a new constraint: all locations must be a Location (i.e. you can no longer create your own location structure, but could before).
We should probably just update this test to follow the Location type. Though maybe put something in it to identify it actually called our test callback rather than the default (since both would produce the same result at that point...)
This is basically a prerequisite of enforcing the no-explicit-any lint rule.
We should probably just update this test to follow the Location type. Though maybe put something in it to identify it actually called our test callback rather than the default (since both would produce the same result at that point...)
This makes sense to me. The best option I can come up with is to create a class that implements Location, and then do instanceof checks in the assertions.
parse5/packages/parse5/lib/parser/parser-location-info.test.ts
Lines 235 to 290 in f5dd91e
This test currently creates its own location structure and asserts that it ends up in the resulting node.
It currently passes because of its parameters being
any
. However, if we strongly type those, the test fails to compile.This is because during the TS conversion, we introduced a new constraint: all locations must be a
Location
(i.e. you can no longer create your own location structure, but could before).We should probably just update this test to follow the
Location
type. Though maybe put something in it to identify it actually called our test callback rather than the default (since both would produce the same result at that point...)This is basically a prerequisite of enforcing the
no-explicit-any
lint rule.cc @fb55
The text was updated successfully, but these errors were encountered: