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

feat: add cwd option to es6+ instrument command #1024

Merged

Commits on Mar 12, 2019

  1. Enable '--cwd' option for nyc instrument command

         - Notes:
            Add instrument command support for the 'cwd' option
            Refactor nyc-integration instrument tests so tests with output folder specified aren't in the no output folder suite
            Refactor instrument.js and instrumentAllFiles command to use modern javascript
            Remove call to deprecated 'process.exit()' in instrument command
            Use file extension as an index to find the correct transform, rather than trying to match a transform name to the rightmost characters of a filename
                * There is another one of these in the code base but it's out of the scope of this PR
            BTW, I'm not going to widen the scope of this PR, this is it!
         - Assumptions:
            If you're instrumenting a single file cwd/a/b/d.js, and specifying an output directory cwd/e, the result will be cwd/e/d.js
            That we want to use file extensions for find transforms, the existing implementation would use the '.js' instrumenter for both '.js' and '.mjs' files, these changes assume that was wrong.
    	That the filename in the covered file should be of the form './path/to/file.js'
    Andrew Finlay committed Mar 12, 2019
    Copy the full SHA
    cdffff8 View commit details
    Browse the repository at this point in the history
  2. Remove any left over instrument --cwd changes

    Andrew Finlay committed Mar 12, 2019
    Copy the full SHA
    aaece80 View commit details
    Browse the repository at this point in the history
  3. Add support for --cwd option to nyc instrument command

    This is intended to sit on top of the nyc es2015+ commit.  It uses the cwd option and its defaults in nyc to make paths more consistent.
    Andrew Finlay committed Mar 12, 2019
    Copy the full SHA
    0f4194b View commit details
    Browse the repository at this point in the history
  4. Get latest

    Andrew Finlay committed Mar 12, 2019
    Copy the full SHA
    85117f0 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2019

  1. Update PR to work with latest

    Andrew Finlay committed Mar 13, 2019
    Copy the full SHA
    23f875f View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2019

  1. no message

    Andrew Finlay committed Mar 19, 2019
    Copy the full SHA
    9822a8b View commit details
    Browse the repository at this point in the history
  2. Address review issues

    All changed, so all this does now is propagate `cwd` so that it can influence `testExclude` and `require` path settings.
    Andrew Finlay committed Mar 19, 2019
    Copy the full SHA
    c454b56 View commit details
    Browse the repository at this point in the history