Skip to content

Commit

Permalink
feat!: Drop support for Node.js < 10.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell committed Feb 13, 2021
1 parent 8176274 commit bf993cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ os:
- linux

node_js:
- "node"
- "14"
- "12"
- "10"
- "8"

matrix:
include:
- os: windows
node_js: "latest"
exclude:
- os: windows
node_js: "node"

after_success: npm run coverage
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
},
"homepage": "https://github.com/istanbuljs/babel-plugin-istanbul#readme",
"engines": {
"node": ">=8"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { default as readCoverage } from './read-coverage.js'
function getRealpath (n) {
try {
return realpathSync(n) || /* istanbul ignore next */ n
} catch (e) {
} catch {
/* istanbul ignore next */
return n
}
Expand Down
4 changes: 1 addition & 3 deletions src/visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ function coverStatement (path) {
this.insertStatementCounter(path)
}

/* istanbul ignore next: no node.js support */
function coverAssignmentPattern (path) {
const n = path.node
const b = this.cov.newBranch('default-arg', n.loc)
Expand Down Expand Up @@ -455,8 +454,7 @@ function coverLogicalExpression (path) {
const leaves = []
this.findLeaves(path.node, leaves)
const b = this.cov.newBranch('binary-expr', path.node.loc)
for (let i = 0; i < leaves.length; i += 1) {
const leaf = leaves[i]
for (const leaf of leaves) {
const hint = this.hintFor(leaf.node)
if (hint === 'next') {
continue
Expand Down
7 changes: 7 additions & 0 deletions test/babel-plugin-istanbul.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ t.test('double-instrument', async t => {
t.equal(code1, code2)
})

t.test('assignment pattern', async t => {
t.match(
instrument('({a = 24} = {})'),
'cov;cov.s[0]++;({a=(cov.b[0][0]++,24)}={});'
)
})

t.test('logical', async t => {
const logicalExp = logic => t.match(
instrument(`const a = b ${logic} 1`),
Expand Down

0 comments on commit bf993cd

Please sign in to comment.