-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Feature: Add support for .rejects.toThrowWithMessage
#315
Feature: Add support for .rejects.toThrowWithMessage
#315
Conversation
@GerkinDev any updates on this? I can see you have conflicts. |
Looks like the original maintainers did some changes 2 weeks ago in 4849c57 creating the conflict. Problem is, this PR has a counterpart PR https://github.com/keeganwitt/jest-extended/pull/57 in a forked repo, and I don't know which will be updated or not. Both repositories have recent changes by @keeganwitt and are not in sync. Thus, I would have to create 2 separate PRs with 2 separate git history to match each repo, and I won't do that. @keeganwitt can you please do something ? Rebase one on the other, or do a merge of some sort, or tell me which repo is the most likely to integrate this PR ? Conflicts are purely on version changes, mine having updated |
I made a fork and started merging MRs into it because I wasn't sure the status of this repo and whether it was still maintained and would get stuff merged. Now that I've found it's in fact not abandoned, my fork should be unnecessary. I'll close the MRs in my fork, to help avoid the confusion (and once my MRs here are merged, delete my fork to clean up those references). |
@keeganwitt do you know who is in charge of this repo and active then ? I'll resolve conflict asap once I know it wont have time to have other conflicts again. Time is precious |
I don't think specific people have said "I'll be handling this work" at this time, and I don't want to speak for others. But there are people with access (I was originally concerned no one besides Matt had access). Sorry that I don't have a more specific answer. |
Okay then, so I'm waiting here with my hand raised hoping someone will ping me soon |
@GerkinDev just to clarify, this project is in jest-community, so all of the Jest contributors help maintain it. |
README.md
Outdated
- [.toBeAfter(date)](#tobeafterdate) | ||
- [.toBeBefore(date)](#tobebeforedate) | ||
- Further proposals in [#117](https://github.com/jest-community/jest-extended/issues/117) PRs welcome | ||
- [~~Date~~](#date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, this was auto generated by tooling, not by hand. I'm not sure what I should do to fix formatting.
README.md
Outdated
@@ -435,7 +437,7 @@ test('passes when value is a function', () => { | |||
Use `.toThrowWithMessage` when checking if a callback function throws an error with a given error type and given error message. Message can either be a `String` or a `RegExp`. | |||
|
|||
```js | |||
test('throws an error of type TypeError with message "hello world"', () => { | |||
test('throws an error of type TypeError with message "hello world"', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a separate test instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in a05d5ce
package.json
Outdated
@@ -35,23 +35,22 @@ | |||
"license": "MIT", | |||
"repository": "jest-community/jest-extended", | |||
"devDependencies": { | |||
"@babel/cli": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hesitant to change the babel setup in this PR because it's unrelated. Can you revert and handle separately? @keeganwitt has been working on the babel upgrade in a separate stream of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentionned in the PR description, this bump is a direct dependency of the update of babel-jest@>=24.0.0
, required because jest@>=24.0.0
exposes context properties allowing specific behavior depending on the async context. I doubt this PR could be done reliabily and being compatible with jest@^23.0.0
& jest@^24.0.0
.
package.json
Outdated
"eslint": "^4.9.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-jest": "^21.2.0", | ||
"husky": "^0.14.3", | ||
"import-all.macro": "^2.0.3", | ||
"jest": "^23.0.1", | ||
"jest": "^24.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a dev dependency, and master is already bumped to 24.
Yes, sorry if that was unclear in my response. No specific person(s) has taken primary responsibility, but it continues to be collectively maintained by the team. There just isn't any specific people to |
Up ? |
Hey team - any idea when this will go through? Would love to use this change. Thank you |
Up. More and more conflicts.... |
Rebased on latest main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
could you remove the changes in package.json and the lockfile? They should be needed (and are updated in main
) 🙂
@SimenB here you are ! Rebased and pruned from useless chore ! |
Codecov Report
@@ Coverage Diff @@
## main #315 +/- ##
===========================================
+ Coverage 0 100.00% +100.00%
===========================================
Files 0 117 +117
Lines 0 681 +681
Branches 0 108 +108
===========================================
+ Hits 0 681 +681
Continue to review full report at Codecov.
|
Thank you, and thanks for your patience here! |
What
This feature adds suport for
expect(promise).rejects.toThrowWithMessage
, which previously throwed because passed tested value was not a function. This test is now conditionnaly skipped if the matcher is called fromrejects
.Why
Closes #219
Notes
This change required an update to
jest@^24.0.0
to use features mentioned in the corresponding changelog, and in particular this PR.This update of
jest
required an update ofbabel-jest@^24.0.0
, which is incopatible withbabel-core@^6.26.0
. Thus,babel-core
&babel-cli
were removed and replaced with@babel/core@^7.0.0
&@babel/cli@^7.0.0
, and use of@babel/preset-env@^7.0.0
. All changes in babel/build-related deps are a direct result of those chained required updates.This PR is directly installable as a dependency in projects with:
Housekeeping