Skip to content

Commit

Permalink
Merge pull request #4 from istanbuljs/master
Browse files Browse the repository at this point in the history
Get latest
  • Loading branch information
AndrewFinlay authored Jan 14, 2019
2 parents 03018ca + 35710b1 commit 94715f0
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 28 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
sudo: false
language: node_js
os:
- windows
- linux
- osx
node_js:
- "node"
- 10
- 8
- 6
- "stable"
matrix:
## An ENOMEM error occurs with 11.6.0 under Travis-CI for Windows.
## Disable until we can determine the cause.
# include:
# - os: windows
# node_js: "latest"
exclude:
- os: windows
node_js: "node"
git:
depth:
1
env:
secure: "SVg7NpV0Sru296kdp+eFl07RFjtJy242fWQ1KDCUdk/1EtZEOzBoSKP7Tn3zX/VLBieexL0T31EwYvRztnL97Sr8VgpYU0z95vCPO8FrixElJR6NH3dqrKeNzC3xOYdV0fy2b4UMlPJOI0aYDT1KHm1aWtkb2J8zqII+XbMtlDaelfHCDxa2+RBII9nYYDP62z+0chQFS6MGPSNwve3G2emYHZpYP5iTFmOzaFUCAjLskKvnnsY0jyx5XssqAo17747WKZl5SDgN8YHZIwhE5tB9m9j3MGjJhwdsR3kmq2om0GD1tQFFAXzWhWad3zNBUE4fLqswgASi39o5NIEzvSRzpw77ttOkkIFGem0l421Zi25W8x5n6GZvP06Y47ddmjNBlniwIzG4fb3dbIByCy/g5SjUYmfnke7stXXBKsPv0eEadlLGFWnG5RIfnyGjvUgQ//QXSAnBBzYF9IK+KUdU8c9kHF6kPybsGEzjQoX+4EJL6kZ4sNX9qxjHERUr4Jb6rAMOnKI9VtCBNqwcCC3nV5DDWHS86hKwbuTbBFkszP7majOi0kUQJTO/tZGwVVcphSDwhL5QkmMepLOqXyRICdUcB2ffXHYhZLiZPofYdom8csaDolqFkotJEBj3GM3gwHvUC3i1vxshxtjF6NHjanhpiIpHLRCs6R1RESE="

after_script:
- "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Build Status](https://travis-ci.org/istanbuljs/nyc.svg?branch=master)](https://travis-ci.org/istanbuljs/nyc)
[![Coverage Status](https://coveralls.io/repos/bcoe/nyc/badge.svg?branch=)](https://coveralls.io/r/bcoe/nyc?branch=master)
[![NPM version](https://img.shields.io/npm/v/nyc.svg)](https://www.npmjs.com/package/nyc)
[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/nyc-ilw23/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/nyc-ilw23)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![community slack](http://devtoolscommunity.herokuapp.com/badge.svg)](http://devtoolscommunity.herokuapp.com)

Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

69 changes: 69 additions & 0 deletions test/nyc-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,75 @@ describe('the nyc cli', function () {
})
})

describe('--temp-dir', function () {
beforeEach(() => {
rimraf.sync(path.resolve(fixturesCLI, '.nyc_output'))
rimraf.sync(path.resolve(fixturesCLI, '.temp_directory'))
rimraf.sync(path.resolve(fixturesCLI, '.temp_dir'))
})

it('creates the default \'tempDir\' when none is specified', function (done) {
var args = [bin, process.execPath, './half-covered.js']

var proc = spawn(process.execPath, args, {
cwd: fixturesCLI,
env: env
})

proc.on('close', function (code) {
code.should.equal(0)
var tempFiles = fs.readdirSync(path.resolve(fixturesCLI, '.nyc_output'))
tempFiles.length.should.equal(1)
var cliFiles = fs.readdirSync(path.resolve(fixturesCLI))
cliFiles.should.include('.nyc_output')
cliFiles.should.not.include('.temp_dir')
cliFiles.should.not.include('.temp_directory')
done()
})
})

it('prefers \'tempDirectory\' to \'tempDir\'', function (done) {
var args = [bin, '--tempDirectory', '.temp_directory', '--tempDir', '.temp_dir', process.execPath, './half-covered.js']

var proc = spawn(process.execPath, args, {
cwd: fixturesCLI,
env: env
})

proc.on('exit', function (code) {
code.should.equal(0)
var tempFiles = fs.readdirSync(path.resolve(fixturesCLI, '.temp_directory'))
tempFiles.length.should.equal(1)
var cliFiles = fs.readdirSync(path.resolve(fixturesCLI))
cliFiles.should.not.include('.nyc_output')
cliFiles.should.not.include('.temp_dir')
cliFiles.should.include('.temp_directory')
done()
})
})

it('uses the \'tempDir\' option if \'tempDirectory\' is not set', function (done) {
var args = [bin, '--tempDir', '.temp_dir', process.execPath, './half-covered.js']

var proc = spawn(process.execPath, args, {
cwd: fixturesCLI,
env: env
})

proc.on('exit', function (code) {
code.should.equal(0)
var tempFiles = fs.readdirSync(path.resolve(fixturesCLI, '.temp_dir'))
tempFiles.length.should.equal(1)
var cliFiles = fs.readdirSync(path.resolve(fixturesCLI))
cliFiles.should.not.include('.nyc_output')
cliFiles.should.include('.temp_dir')
cliFiles.should.not.include('.temp_directory')
rimraf.sync(path.resolve(fixturesCLI, '.temp_dir'))
done()
})
})
})

describe('noop instrumenter', function () {
it('setting instrument to "false" configures noop instrumenter', function (done) {
var args = [
Expand Down

0 comments on commit 94715f0

Please sign in to comment.