Skip to content

tragedy strikes: --no-clean and no temp directory #663

@boneskull

Description

@boneskull

Expected Behavior

use with --no-clean flag doesn't throw if there's no temp dir (typically .nyc_output)

Observed Behavior

Error: ENOENT: no such file or directory, scandir '/Users/boneskull/Documents/projects/mocha/.nyc_output'
    at Object.fs.readdirSync (fs.js:910:18)
    at NYC.loadReports (/Users/boneskull/Documents/projects/mocha/node_modules/nyc/index.js:479:31)
    at NYC._getCoverageMapFromAllCoverageFiles (/Users/boneskull/Documents/projects/mocha/node_modules/nyc/index.js:412:8)
    at NYC.report (/Users/boneskull/Documents/projects/mocha/node_modules/nyc/index.js:421:18)
    at report (/Users/boneskull/Documents/projects/mocha/node_modules/nyc/bin/nyc.js:89:7)
    at /Users/boneskull/Documents/projects/mocha/node_modules/nyc/bin/nyc.js:76:27
    at ChildProcess.<anonymous> (/Users/boneskull/Documents/projects/mocha/node_modules/nyc/node_modules/foreground-child/index.js:52:5)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
make: *** [test-bdd] Error 1                                    

Bonus Points! Code (or Repository) that Reproduces Issue

Well, createTempDirectory() isn't called if clean is falsy.

Forensic Information

macOS; https://gist.github.com/boneskull/fbb28823e66a439f4a7fc735cb883917

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions