@putout/test 7.1.0 → 7.2.0
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/test.js +4 -3
- package/package.json +2 -2
package/lib/test.js
CHANGED
|
@@ -38,6 +38,7 @@ const TS = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const readFixture = (name) => {
|
|
41
|
+
const {readFileSync} = global.__putout_test_fs;
|
|
41
42
|
const [e, data] = tryCatch(readFileSync, `${name}.ts`, 'utf8');
|
|
42
43
|
|
|
43
44
|
if (!e)
|
|
@@ -278,10 +279,9 @@ const toObject = (array) => {
|
|
|
278
279
|
const transform = currify((dir, options, t, name, transformed = null, addons = {}) => {
|
|
279
280
|
const {plugins} = options;
|
|
280
281
|
const full = join(dir, name);
|
|
281
|
-
const [input, isTS] = readFixture(full);
|
|
282
282
|
const isStr = isString(transformed);
|
|
283
283
|
|
|
284
|
-
const [
|
|
284
|
+
const [input, isTS] = readFixture(full);
|
|
285
285
|
|
|
286
286
|
if (!isStr)
|
|
287
287
|
addons = transformed;
|
|
@@ -304,10 +304,11 @@ const transform = currify((dir, options, t, name, transformed = null, addons = {
|
|
|
304
304
|
code,
|
|
305
305
|
isTS,
|
|
306
306
|
});
|
|
307
|
-
|
|
308
307
|
return t.pass('fixed fixture updated');
|
|
309
308
|
}
|
|
310
309
|
|
|
310
|
+
const [output] = isStr ? [transformed] : readFixture(`${full}-fix`);
|
|
311
|
+
|
|
311
312
|
return t.equal(code, output);
|
|
312
313
|
});
|
|
313
314
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/test",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Test runner for 🐊Putout plugins ",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"c8": "^8.0.0",
|
|
66
66
|
"eslint": "^8.0.1",
|
|
67
67
|
"eslint-plugin-n": "^16.0.0",
|
|
68
|
-
"eslint-plugin-putout": "^
|
|
68
|
+
"eslint-plugin-putout": "^20.0.0",
|
|
69
69
|
"lerna": "^6.0.1",
|
|
70
70
|
"madrun": "^9.0.0",
|
|
71
71
|
"mock-require": "^3.0.3",
|