@putout/test 5.5.0 → 5.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/processor/index.js +6 -2
- package/package.json +2 -2
package/lib/processor/index.js
CHANGED
|
@@ -15,7 +15,11 @@ const processFile = require('putout/process-file');
|
|
|
15
15
|
const {runProcessors} = require('@putout/engine-processor');
|
|
16
16
|
|
|
17
17
|
const isStr = (a) => typeof a === 'string';
|
|
18
|
-
const isUpdate = () => global.process.env.UPDATE;
|
|
18
|
+
const isUpdate = () => Number(global.process.env.UPDATE);
|
|
19
|
+
const update = async (a, b) => {
|
|
20
|
+
const write = global.writeFile || writeFile;
|
|
21
|
+
await write(a, b);
|
|
22
|
+
};
|
|
19
23
|
|
|
20
24
|
const buildOptions = ({options, plugins, processors}) => ({
|
|
21
25
|
...options,
|
|
@@ -116,7 +120,7 @@ async function process(filename, dir, {processors, plugins, extension, fix = tru
|
|
|
116
120
|
});
|
|
117
121
|
|
|
118
122
|
if (isUpdate() && !noChange)
|
|
119
|
-
await
|
|
123
|
+
await update(outputName, processedSource);
|
|
120
124
|
|
|
121
125
|
return {
|
|
122
126
|
processedSource,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/test",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Test runner for 🐊Putout plugins ",
|
|
7
7
|
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/test#readme",
|
|
8
8
|
"main": "lib/test.js",
|
|
9
9
|
"bin": {
|