@putout/test 7.3.0 → 7.4.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.
Files changed (2) hide show
  1. package/lib/test.js +5 -3
  2. package/package.json +2 -2
package/lib/test.js CHANGED
@@ -21,6 +21,7 @@ const isObject = (a) => typeof a === 'object';
21
21
  const {isArray} = Array;
22
22
 
23
23
  const {keys, entries} = Object;
24
+ const maybeEntries = (a) => isArray(a) ? a : entries(a).pop();
24
25
 
25
26
  global.__putout_test_fs = {
26
27
  readFileSync,
@@ -82,6 +83,7 @@ const rmFixture = (name) => {
82
83
 
83
84
  module.exports = createTest;
84
85
  module.exports.createTest = createTest;
86
+ module.exports._maybeEntries = maybeEntries;
85
87
 
86
88
  const parsePlugin = (plugins) => {
87
89
  if (isArray(plugins))
@@ -543,7 +545,7 @@ function preTest(test, plugin) {
543
545
  filter,
544
546
  match,
545
547
  declare,
546
- }] = entries(plugin).pop();
548
+ }] = maybeEntries(plugin);
547
549
 
548
550
  const options = {
549
551
  checkDuplicates: false,
@@ -568,7 +570,7 @@ function preTest(test, plugin) {
568
570
 
569
571
  if (!declare)
570
572
  test(`${name}: report: is function`, (t) => {
571
- t.equal(typeof report, 'function', 'should export "report" function');
573
+ t.equal(typeof report, 'function', `should export 'report' function`);
572
574
  t.end();
573
575
  }, options);
574
576
 
@@ -589,7 +591,7 @@ function preTest(test, plugin) {
589
591
  declare,
590
592
  });
591
593
 
592
- t.ok(result, 'should export "replace", "find", "traverse", "include", "exclude", or "declare" function');
594
+ t.ok(result, `should export 'replace', 'find', 'traverse', 'include', 'exclude', or 'declare' function`);
593
595
  t.end();
594
596
  }, options);
595
597
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/test",
3
- "version": "7.3.0",
3
+ "version": "7.4.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": "^20.0.0",
68
+ "eslint-plugin-putout": "^21.0.0",
69
69
  "lerna": "^6.0.1",
70
70
  "madrun": "^9.0.0",
71
71
  "mock-require": "^3.0.3",