-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite seems to have reached parity
- Loading branch information
Showing
21 changed files
with
283 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const matchers = { | ||
"base-generative": require("./generative-matcher"), | ||
"base-comparative": require("./comparative-matcher"), | ||
"contains-comparative": require("./contains-comparative-matcher"), | ||
} | ||
|
||
module.exports = function getMatcher (name) { | ||
if (matchers[name]) return matchers[name]; | ||
throw new Error("matching plugins not implemented"); | ||
return require("perturb-matcher-" + name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
module.exports = { | ||
const reporters = { | ||
diff: require("./diff"), | ||
} | ||
|
||
module.exports = function getReporter (name) { | ||
if (reporters[name]) return reporters[name]; | ||
throw new Error("reporter plugins not implemented"); | ||
return require("perturb-reporter-" + name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use strict"; | ||
|
||
const Future = require("bluebird"); | ||
|
||
function runMutation (mutation) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,59 @@ | ||
const path = require("path"); | ||
|
||
const perturb = require("./index.js"); | ||
function run (perturb, which, cb) { | ||
let config; | ||
|
||
const src = path.join(__dirname, "../lib"); | ||
const test = path.join(__dirname, "../test"); | ||
switch (which) { | ||
case "dogfood": | ||
config = { | ||
rootDir: path.join(__dirname, ".."), | ||
runner: "mocha", | ||
}; | ||
break; | ||
|
||
perturb({ | ||
rootDir: path.join(__dirname, ".."), | ||
runner: "mocha", | ||
}); | ||
case "example": | ||
config = { | ||
rootDir: path.join(__dirname, "../examples/toy-lib"), | ||
runner: "mocha", | ||
}; | ||
break; | ||
|
||
default: | ||
throw new Error("Unknown config " + which); | ||
} | ||
|
||
if (cb) { | ||
return perturb(config, function (err, results) { | ||
if (err) { | ||
console.log("fatal error in perturb"); | ||
console.log(err); | ||
console.log(err.stack); | ||
cb(err); | ||
process.exit(1); | ||
} | ||
|
||
console.log(results) | ||
try { | ||
console.log("kill count", results.filter(r => r.error).length, "/", results.length) | ||
} catch (e) {} | ||
cb(null, results); | ||
}); | ||
} | ||
|
||
return perturb(config) | ||
.then(function (results) { | ||
console.log("kill count", results.filter(r => r.error).length, "/", results.length) | ||
return results; | ||
}).catch(function (err) { | ||
console.log("fatal error in perturb"); | ||
console.log(err); | ||
console.log(err.stack); | ||
process.exit(1); | ||
}); | ||
} | ||
|
||
if (!module.parent) { | ||
run(proess.argv[2], require("./")) | ||
} | ||
|
||
module.exports = run; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.