Skip to content

Commit

Permalink
feat: drop Node 0.10 and 0.12 support, upgrade dependencies to reflec…
Browse files Browse the repository at this point in the history
…t this (#88)

BREAKING CHANGE: I've updated dependencies and dropped Node 0.10 and Node 0.12 support.
  • Loading branch information
bcoe committed Jan 29, 2017
1 parent f0b8d7e commit 594c03a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 94 deletions.
12 changes: 2 additions & 10 deletions .travis.yml
Expand Up @@ -7,13 +7,5 @@ after_success: npm run coverage

node_js:
- "4"
- "node"

# mock-fs breaks the test-suite in Node 0.10,
# we circument this by skipping mock-fs related
# tests. This hack is also required which prevents
# mocha from loading mock-fs in files it instruments.
matrix:
include:
- node_js: "0.10"
env: FS_MOCK=./package.json
- "6"
- "stable"
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# babel-plugin-istanbul

[![Build Status](https://travis-ci.org/istanbuljs/babel-plugin-istanbul.svg)](https://travis-ci.org/istanbuljs/babel-plugin-istanbul)
[![Build Status](https://travis-ci.org/istanbuljs/babel-plugin-istanbul.svg?branch=master)](https://travis-ci.org/istanbuljs/babel-plugin-istanbul)
[![Coverage Status](https://coveralls.io/repos/github/istanbuljs/babel-plugin-istanbul/badge.svg?branch=master)](https://coveralls.io/github/istanbuljs/babel-plugin-istanbul?branch=master)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)

Expand Down
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -9,7 +9,7 @@
"lib"
],
"dependencies": {
"find-up": "^1.1.2",
"find-up": "^2.1.0",
"istanbul-lib-instrument": "^1.4.2",
"object-assign": "^4.1.0",

This comment has been minimized.

Copy link
@wtgtybhertgeghgtwtg

wtgtybhertgeghgtwtg Feb 6, 2017

Contributor

Shouldn't this be removed, too?

This comment has been minimized.

Copy link
@bcoe

bcoe Feb 6, 2017

Author Member

@wtgtybhertgeghgtwtg great point, would you like to make a pull request.

This comment has been minimized.

Copy link
@wtgtybhertgeghgtwtg

wtgtybhertgeghgtwtg Feb 6, 2017

Contributor

PR: #92.

"test-exclude": "^4.0.0"
Expand All @@ -20,9 +20,8 @@
"babel-preset-es2015": "^6.18.0",
"chai": "^3.5.0",
"coveralls": "^2.11.15",
"cross-env": "^2.0.1",
"cross-env": "^3.1.4",
"mocha": "^3.2.0",
"mock-fs": "^3.12.1",
"nyc": "^10.0.0",
"pmock": "^0.2.3",
"standard": "^8.6.0",
Expand All @@ -32,7 +31,7 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "babel src --out-dir lib",
"pretest": "standard && npm run release",
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require=${FS_MOCK:-mock-fs} test/*.js",
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.js",
"prepublish": "npm test && npm run release",
"version": "standard-version"
},
Expand Down
79 changes: 0 additions & 79 deletions test/babel-plugin-istanbul.js
@@ -1,8 +1,6 @@
/* eslint-env mocha */

const babel = require('babel-core')
import mockProcess from 'pmock'
import fs from 'fs'
import makeVisitor from '../src'

require('chai').should()
Expand Down Expand Up @@ -89,83 +87,6 @@ describe('babel-plugin-istanbul', function () {
})
})

// Regression tests for https://github.com/istanbuljs/babel-plugin-istanbul/issues/7
if (!/^v0\.10/.test(process.version)) { // mock-fs does not work on Node 0.10.
const mockFs = require('mock-fs')
context('when current path uses a symlink', function () {
beforeEach(function () {
mockFs({
'/project': {
'fixtures': {
'should-cover.js': fs.readFileSync('./fixtures/should-cover.js')
},
'package.json': fs.readFileSync('./package.json')
},
'/symlink': mockFs.symlink({path: '/project'})
})
})

const shouldInstrument = file => {
var result = babel.transformFileSync(file, {
plugins: [
makeVisitor({types: babel.types})
]
})
result.code.should.match(/statementMap/)
}

context('and NYC_CWD is set', function () {
var env

beforeEach(function () {
env = mockProcess.env({
NYC_CWD: '/symlink'
})
})

it('should instrument file accessed via link', function () {
shouldInstrument('/symlink/fixtures/should-cover.js')
})

it('should instrument file accessed via real path', function () {
shouldInstrument('/project/fixtures/should-cover.js')
})

afterEach(function () {
env.reset()
})
})

context('and only process.cwd() is set', function () {
var env, cwd

beforeEach(function () {
env = mockProcess.env({
NYC_CWD: ''
})
cwd = mockProcess.cwd(fs.realpathSync('/symlink')) // realpath because of mock-fs Windows quirk re: process.cwd
})

it('should instrument file accessed via link', function () {
shouldInstrument('/symlink/fixtures/should-cover.js')
})

it('should instrument file accessed via real path', function () {
shouldInstrument('/project/fixtures/should-cover.js')
})

afterEach(function () {
env.reset()
cwd.reset()
})
})

afterEach(function () {
mockFs.restore()
})
})
}

// TODO: setup istanbul-lib-instrument, such that we can
// run various babel configurations.
context('regression tests', () => {
Expand Down

0 comments on commit 594c03a

Please sign in to comment.