-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): more test tools + adds test related to debuggin issues
- Loading branch information
Showing
10 changed files
with
375 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// this is a template! | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const root = __dirname; | ||
const writeProcessIoTo = {{writeProcessIoTo}}; | ||
|
||
exports.afterProcess = function (args, result) { | ||
// const source = args[0]; | ||
const filePath = args[1]; | ||
const relPath = path.relative(root, filePath); | ||
if (writeProcessIoTo && filePath.startsWith(`${root}${path.sep}`)) { | ||
const dest = `${path.join(writeProcessIoTo, relPath)}.json`; | ||
const segments = relPath.split(path.sep); | ||
segments.pop(); | ||
const madeSegments = []; | ||
segments.forEach(segment => { | ||
madeSegments.push(segment); | ||
const p = join(writeProcessIoTo, madeSegments.join(sep)); | ||
if (!fs.existsSync(p)) fs.mkdirSync(p); | ||
}); | ||
fs.writeFileSync(dest, JSON.stringify({ | ||
in: args, | ||
out: typeof result === 'object' ? result.code : result, | ||
}), 'utf8'); | ||
} | ||
} |
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.