-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix CI: update yeoman-generator to 3.x, apply latest prettier formatting #1578
Conversation
For context, the tests are failing because of the upgrades made between I've spent hours into trying to fix around the code in yeoman so that the error can just be rejected, but despite being caught in a If anybody can see something that I missed that can be fixed in yeoman to address this issue, I'd be super happy know so that I feel my time investment in this issue can be justified :p I'm just very peeved at yeoman that we have to essentially write our own error-handling system ( |
throw new Error('Generator should have failed.'); | ||
}, | ||
err => { | ||
expect(err).to.match(/No models found in /); |
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 I understand expect().to.be.rejectedWith(/regexp/)
, it works exactly the same way as the new code which you wrote here using .then(onSuccess, onFailure)
. I personally prefer rejectedWith
as it's less code to maintain and makes it more difficult to introduce an error.
What are the reasoning behind this change? Can we revert it please?
throw new Error('Generator should have failed.'); | ||
}, | ||
err => { | ||
expect(err).to.match(/No repositories found in /); |
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.
Ditto, can we keep using rejectedWith
instead?
true, | ||
); | ||
} catch (err) { | ||
return this.exit(err); |
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.
Having to catch errors and report them via this.exit
feels ugly to me, but if there isn't any better way, then I can live with it.
@shimks could you please add a description of this problem to #844, the issue tracking all issues we have with Yeoman? Sometimes it makes me wonder how much more difficult things have to get before we agree to get rid of Yeoman.
I took a quick look. Isn't it possible to install Anyhow, these recent changes in yeoman look wrong to me, I think we should open an issue in yeoman, try to convince yeoman maintainers that the current behavior is not correct and get it fixed (possibly contributing the fix ourselves). |
Co-Authored-By: Kyusung Shim <kyu.shim@ibm.com>
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.
Not sure if my approval would count here, but your latest changes look good to me
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.
👌
BTW: I changed the pull request title so that it better describe what is being changed. "Fix ci" is not very helpful when you see it as an entry in the list pull requests. |
Thank you for that! I think it just picked up the branch name instead of the commit message because there were multiple commits. I'll be more careful to update the PR Name in the future. |
Make
master
go green again by:Commit 1
yeoman-generator
to 3.xCommit 2
front-matter
have been removed.Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated