New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put asserts
on various assert
functions.
#69364
Conversation
This was battle-tested in Chrome DevTools now, and adds a bunch of `asserts` onto various functions on the `assert` function (as well as the `assert` function itself) to help with type narrowing in unit tests when using Chai.
@bmeurer Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 69364,
"author": "bmeurer",
"headCommitOid": "f3382ddae1d1e028c92f56946d313849f13f07c6",
"mergeBaseOid": "da49c537cc32dc8148150f783fcfa28a8ff29856",
"lastPushDate": "2024-04-15T18:24:26.000Z",
"lastActivityDate": "2024-05-02T12:57:38.000Z",
"mergeOfferDate": "2024-05-01T17:15:27.000Z",
"mergeRequestDate": "2024-05-02T12:57:38.000Z",
"mergeRequestUser": "bmeurer",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "chai",
"kind": "edit",
"files": [
{
"path": "types/chai/chai-tests.ts",
"kind": "test"
},
{
"path": "types/chai/index.d.ts",
"kind": "definition"
}
],
"owners": [
"Bartvds",
"AGBrown",
"olivr70",
"mwistrand",
"shaunluttin",
"micksatana",
"ErikSchierboom",
"bparan",
"CXuesong",
"joeykilpatrick"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "rbuckton",
"date": "2024-05-01T17:14:47.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 2057547100,
"ciResult": "pass"
} |
🔔 @Bartvds @AGBrown @olivr70 @mwistrand @shaunluttin @micksatana @ErikSchierboom @bparan @CXuesong @joeykilpatrick — please review this PR in the next few days. Be sure to explicitly select |
@sheetalkamat @weswigham friendly ping |
Re-ping @Bartvds, @AGBrown, @olivr70, @mwistrand, @shaunluttin, @micksatana, @ErikSchierboom, @bparan, @CXuesong, @joeykilpatrick: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
@bmeurer: Everything looks good here. I am ready to merge this PR (at f3382dd) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@Bartvds, @AGBrown, @olivr70, @mwistrand, @shaunluttin, @micksatana, @ErikSchierboom, @bparan, @CXuesong, @joeykilpatrick: you can do this too.) |
Ready to merge |
This was battle-tested in Chrome DevTools now, and adds a bunch of
asserts
onto various functions on theassert
function (as well as theassert
function itself) to help with type narrowing in unit tests when using Chai.asserts
into@types/chai
(a slightly older version) for Chrome DevTools).chai-test.ts
contains a new test suite for type narrowing).pnpm test <package to test>
.If changing an existing definition:
Why?
This is a reland with a bugfix and some additions of #68780, where this time we have battle-tested it in Chrome DevTools first, and we're now ready and confident in upstreaming these changes.
@sheetalkamat @weswigham can you take a look again please?