Skip to content
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: default config values for yml files #171

Merged
merged 1 commit into from
Feb 28, 2018
Merged

fix: default config values for yml files #171

merged 1 commit into from
Feb 28, 2018

Conversation

cecilia-sanare
Copy link
Contributor

@cecilia-sanare cecilia-sanare commented Feb 27, 2018

What:

All nps commands would fail given the following conditions were true:

  • User was using a package-scripts.yml instead of a package-scripts.js
  • User didn't pass any options to nps

closes #170

Why:

Current implementation makes it impossible to call nps normally without a minor workaround of some sort.

e.g.

scripts:
  echo: echo "this is a test"

config: {}

How:

yml configurations now go through the same post-process as js configurations.

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@cecilia-sanare
Copy link
Contributor Author

cecilia-sanare commented Feb 27, 2018

@kentcdodds
Travis seemed to slow down for a second when this started and
its almost as if the cli tests somehow interfered with one another.

I'm guessing they would pass if you reran the build.

EDIT

The only way I've been able to consistently reproduce the issue Travis just ran into was by adding the following to the run-nps.js utility.

async function runNPS(cwd, args = '') {
  // It seems to be somehow linked to one test timing out
  // in combination to the other tests taking a while.
  if (args === '-c ./package-scripts-with-default.js') {
    await new Promise(resolve => setTimeout(resolve, 30000))
  } else {
    await new Promise(resolve => setTimeout(resolve, 10000))
  }
  // ...

@codecov
Copy link

codecov bot commented Feb 28, 2018

Codecov Report

Merging #171 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #171   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines         382    382           
  Branches       92     92           
=====================================
  Hits          382    382
Impacted Files Coverage Δ
src/bin-utils/parser.js 100% <ø> (ø) ⬆️
src/bin-utils/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5769c9...b56b0d2. Read the comment docs.

@cecilia-sanare
Copy link
Contributor Author

cecilia-sanare commented Feb 28, 2018

Updating jest-cli seems to have improved the stability of the cli tests.

* updated various dev dependencies
  jest-cli seems to have improved the stability of the tests
@cecilia-sanare
Copy link
Contributor Author

@kentcdodds
This PR should be good to go now. 👍

Copy link
Collaborator

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. Thanks! Just one question.

testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.js'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make these changes?

Copy link
Contributor Author

@cecilia-sanare cecilia-sanare Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing how jest-cli resolves paths for coverage changed somehow in the latest version because with this line it wasn't tracking coverage at all.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh.... Ok, that's fine. I plan to eventually upgrade this package to use kcd-scripts anyway.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this has already been merged, but as an addition.

Changing the jest config to the following seems to have the
same effect as removing the collectCoverageFrom line.

module.exports = {
  // ...
  collectCoverageFrom: ['**/*.js'],
  coveragePathIgnorePatterns: [
    '/coverage/',
    // ...
  ],
  // ...
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'd rather just upgrade this to use kcd-scripts instead.

@kentcdodds kentcdodds merged commit f9a7b0b into sezna:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run nps without any arguments
2 participants