@putout/test 4.1.0 → 4.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/README.md CHANGED
@@ -21,8 +21,8 @@ UPDATE=1 tape test/*.js
21
21
 
22
22
  ## Plugins API
23
23
 
24
- All plugins 🐊`Putout` plugins written in `CommonJS`, since `ESLint` written on `CommonJS` and we have a huge `ESLint`-based ecosystem wich is good to reuse.
25
- `🐊`Putout`can be used in all IDE's supported by`ESLint` as [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/packages/eslint-plugin-putout).
24
+ All plugins 🐊`Putout` plugins written in `CommonJS`, since `ESLint` written on `CommonJS` and we have a huge `ESLint`-based ecosystem which is good to reuse.
25
+ 🐊`Putout`can be used in all IDE's supported by`ESLint` as [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/packages/eslint-plugin-putout).
26
26
  When [async rules will be supported](https://github.com/eslint/eslint/issues/15394) we can switch to `ESM`.
27
27
 
28
28
  To write test for your plugins you need initialize `test` using `createTest`:
@@ -231,8 +231,11 @@ test('formatter: dump: many', async ({formatMany}) => {
231
231
  Here is example of tests for [remove-console](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-console):
232
232
 
233
233
  ```js
234
- const test = require('@putout/test')(__dirname, {
235
- 'remove-console': require('..'),
234
+ const {createTest} = require('@putout/test');
235
+ const removeConsole = require('@putout/plugin-remove-console');
236
+
237
+ const test = createTest(__dirname, {
238
+ 'remove-console': removeConsole,
236
239
  });
237
240
 
238
241
  test('remove-console: report', (t) => {
package/lib/test.mjs CHANGED
@@ -1,9 +1,12 @@
1
- import {createCommons} from 'simport';
1
+ import {dirname} from 'path';
2
+ import {fileURLToPath} from 'url';
2
3
  import create from './test.js';
3
4
 
4
5
  export default create;
5
6
 
6
7
  export const createTest = (url, plugins) => {
7
- const {__dirname} = createCommons(url);
8
+ const __filename = fileURLToPath(url);
9
+ const __dirname = dirname(__filename);
10
+
8
11
  return create(__dirname, plugins);
9
12
  };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@putout/test",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
+ "type": "commonjs",
4
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
6
  "description": "test runner for putout plugins ",
6
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/test#readme",
@@ -37,7 +38,6 @@
37
38
  "@putout/engine-processor": "*",
38
39
  "currify": "^4.0.0",
39
40
  "putout": "*",
40
- "simport": "^1.2.0",
41
41
  "supertape": "^6.0.0",
42
42
  "try-catch": "^3.0.0"
43
43
  },
@@ -59,7 +59,7 @@
59
59
  "c8": "^7.5.0",
60
60
  "eslint": "^8.0.1",
61
61
  "eslint-plugin-node": "^11.0.0",
62
- "eslint-plugin-putout": "^12.0.0",
62
+ "eslint-plugin-putout": "^13.0.0",
63
63
  "lerna": "^4.0.0",
64
64
  "madrun": "^8.0.1",
65
65
  "mock-require": "^3.0.3",