Skip to content

Commit c28ea2d

Browse files
committed
Better handle timeout on windows
1 parent dd065d8 commit c28ea2d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Mutode [![npm](https://img.shields.io/npm/v/mutode.svg)](http://npmjs.com/package/mutode) [![npm](https://img.shields.io/npm/dm/mutode.svg)](http://npmjs.com/package/mutode) [![npm](https://img.shields.io/npm/l/mutode.svg)](LICENSE)
22

3-
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/TheSoftwareDesignLab/mutode.svg?branch=master)](https://travis-ci.org/TheSoftwareDesignLab/mutode) [![Coverage Status](https://coveralls.io/repos/github/TheSoftwareDesignLab/mutode/badge.svg?branch=master)](https://coveralls.io/github/TheSoftwareDesignLab/mutode?branch=master)
3+
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/TheSoftwareDesignLab/mutode.svg?branch=master)](https://travis-ci.org/TheSoftwareDesignLab/mutode) [![Build status](https://ci.appveyor.com/api/projects/status/ulp8cq3aq2bng6he/branch/master?svg=true)](https://ci.appveyor.com/project/DiegoRBaquero/mutode/branch/master)
4+
[![Coverage Status](https://coveralls.io/repos/github/TheSoftwareDesignLab/mutode/badge.svg?branch=master)](https://coveralls.io/github/TheSoftwareDesignLab/mutode?branch=master)
45

56
Mutation testing for Node.js and JavaScript.
67

src/mutantRunner.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ module.exports = function MutantRunner ({mutodeInstance, filePath, contentToWrit
2323
debug(data.toString())
2424
})
2525

26+
let timedout = false
2627
const timeout = setTimeout(() => {
2728
terminate(child.pid)
29+
timedout = true
2830
}, mutodeInstance.timeout).unref()
2931

3032
child.on('exit', (code, signal) => {
@@ -35,7 +37,7 @@ module.exports = function MutantRunner ({mutodeInstance, filePath, contentToWrit
3537
if (code === 0) {
3638
console.log(`${log}\t${chalk.bgRed('survived')} ${timeDiff}`)
3739
mutodeInstance.survived++
38-
} else if (signal) {
40+
} else if (signal || timedout) {
3941
console.log(`${log}\t${chalk.bgBlue('discarded (timeout)')} ${timeDiff}`)
4042
mutodeInstance.discarded++
4143
} else {

0 commit comments

Comments
 (0)