| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
wouldn't it be more performant to leave this as a prototype method, and instead do a public class field test = FunctionPrototypeBind(this.test, this);, so that the "meat" of the method can be shared and optimized across all instances?
separately, couldn't the skip/todo/only methods be assigned to the prototype method once, in a static block, instead of a new function created on every instance?
Sorry, something went wrong.
There was a problem hiding this comment.
If you mean with Object.defineProperty, then without changing the #test to [kTest] it can't as it cannot access private method outside the class.
if you mean adding the skip/todo/any in the constructor but keeping the test function as is, than for some reason it did not work for me
The skip/todo/any methods are needed to assign on the test function, not on the TestContext
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, true, the 3 expandos need to be done in the constructor every time - altho the meat could be shared private methods and the per-instance thing could just be a bound function.
Sorry, something went wrong.
There was a problem hiding this comment.
why not keep as prototype methods?
Sorry, something went wrong.
There was a problem hiding this comment.
for some reason it did not work for me adding skip/todo/etc to the test function
Sorry, something went wrong.
|
The docs for only say
How is that supposed to map to use of only in subtests? Consider test('a', t => { t.test.only('b', () => {}); }) - i.e., a top-level test which is not marked as only with a subtest which is. I can imagine at least two possibilities:
Presumably this implements the first one (though I don't see any tests for that scenario). Either way the docs should be updated, because right now they imply that only is specific to top-level tests. Maybe something like:
|
Sorry, something went wrong.
|
@bakkot this is a known issue and unrelated to this PR or the linked issue If I'm correct #48932 is the one to fix that issue |
Sorry, something went wrong.
|
Removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. as this PR has no approvals |
Sorry, something went wrong.
… subtests
|
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Sorry, something went wrong.
|
Closing this because it has stalled. Feel free to reopen if this issue/PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix #50665