Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Doctor mode #722

Merged
merged 14 commits into from
Aug 29, 2020
Merged

Doctor mode #722

merged 14 commits into from
Aug 29, 2020

Conversation

raineorshine
Copy link
Owner

@raineorshine raineorshine commented Aug 16, 2020

Add --doctor option to iteratively install upgrades and run tests to identify breaking upgrades.

$ ncu --doctor
npm install
npm run test
ncu -u
npm install
npm run test
Failing tests found:
/Users/raine/projects/npm-check-updates/test/doctor/fail/test.js:13
  throw new Error('foo')
  ^
Now let's identify the culprit, shall we?
Restoring package.json
Restoring package-lock.json
npm install
npm install ncu-test-v2@2.0.0
npm run test
  ✓ ncu-test-v2 1.0.0 → 2.0.0
npm install ncu-test-return-version@2.0.0
npm run test
  ✗ ncu-test-return-version 1.0.0 → 2.0.0

@raineorshine
Copy link
Owner Author

@XhmikosR I'm really excited to add this new feature, but something's wrong with the output on Windows. Would you possibly be able to take a look? Would be a big help!

@raineorshine raineorshine merged commit 2191ba3 into master Aug 29, 2020
@raineorshine raineorshine deleted the doctor branch August 29, 2020 14:31
@stoically
Copy link
Collaborator

Excellent addition, thanks for working on this!

@gabriel-kohen-by
Copy link

I love this one. Can we configure additional tasks to run on --doctor mode? test task is obvious but we have some breaks during the actual tasks build.
Thank you.

@raineorshine
Copy link
Owner Author

I love this one. Can we configure additional tasks to run on --doctor mode? test task is obvious but we have some breaks during the actual tasks build.
Thank you.

@gabriel-kohen-by Good idea! Perhaps an option for doctor to run an arbitrary npm script?

ncu -u --doctor --doctor-test foo

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants