supertape 6.12.1 → 7.0.1

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/ChangeLog CHANGED
@@ -1,3 +1,35 @@
1
+ 2022.02.17, v7.0.1
2
+
3
+ fix:
4
+ - (supertape) drop support of node < 16
5
+
6
+ feature:
7
+ - (package) madrun v9.0.0
8
+ - (package) putout v25.0.0
9
+
10
+
11
+ 2022.02.14, v7.0.0
12
+
13
+ fix:
14
+ - chore(actions) add ability to fix
15
+
16
+ feature:
17
+ - supertape: check-scopes, check-assertions-count: enable by default
18
+
19
+
20
+ 2022.01.15, v6.13.1
21
+
22
+ fix:
23
+ - (supertape) revert: add exit code 5 for skip"
24
+
25
+
26
+ 2022.01.15, v6.13.0
27
+
28
+ feature:
29
+ - (supertape) add exit code 5 for skip
30
+ - (@supertape/operator-stub) notCalled: no arg
31
+
32
+
1
33
  2022.01.14, v6.12.1
2
34
 
3
35
  fix:
package/README.md CHANGED
@@ -1,19 +1,25 @@
1
- # 📼 `Supertape` [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # 📼 Supertape [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
3
  [NPMURL]: https://npmjs.org/package/supertape "npm"
4
4
  [NPMIMGURL]: https://img.shields.io/npm/v/supertape.svg?style=flat&longCache=true
5
- [BuildStatusURL]: https://github.com/coderaiser/supertape/actions?query=workflow%3A%22Node+CI%22 "Build Status"
6
- [BuildStatusIMGURL]: https://github.com/coderaiser/supertape/workflows/Node%20CI/badge.svg
5
+ [BuildStatusURL]: https://github.com/coderaiser/putout/actions?query=workflow%3A%22Node+CI%22 "Build Status"
6
+ [BuildStatusIMGURL]: https://github.com/coderaiser/putout/workflows/Node%20CI/badge.svg
7
+ [BuildStatusURL]: https://travis-ci.org/coderaiser/supertape "Build Status"
7
8
  [CoverageURL]: https://coveralls.io/github/coderaiser/supertape?branch=master
8
9
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/supertape/badge.svg?branch=master&service=github
9
10
 
10
- [Tape](https://github.com/substack/tape) compatible [TAP](https://testanything.org/) test runner with superpowers. Contains:
11
+ [![supertape](https://asciinema.org/a/Cgc3rDOfZAeDnJSxzEYpPfBMY.svg)](https://asciinema.org/a/Cgc3rDOfZAeDnJSxzEYpPfBMY)
12
+
13
+ [Tape](https://github.com/substack/tape)-inspired [TAP](https://testanything.org/)-compatible simplest high speed test runner with superpowers.
14
+
15
+ 📼`Supertape` written from scratch after messing a lot with `tape`, it willing to be compatible with it as much as possible.
16
+ and has a couple differences. It contains:
11
17
 
12
18
  - ability to work with [esm modules](https://nodejs.org/api/esm.html) (take a look at [mock-import](https://github.com/coderaiser/mock-import) for mocking).
13
19
  - shows colored diff when test not `equal` or not `deepEqual`;
14
20
  - produces deteiled stack traces for `async functions`;
15
- - as many `only` as you wish
16
- - ability to extend
21
+ - as many `only` as you wish;
22
+ - ability to extend;
17
23
  - smart timeouts for long running tests 🏃‍♂️(configured with `SUPERTAPE_TIMEOUT`);
18
24
  - more natural assertions: `expected, result` -> `result, expected`, for example:
19
25
 
@@ -27,8 +33,6 @@ Doesn't contain:
27
33
  - aliases, methods list much shorter;
28
34
  - `throws`, `doesNotThrows` - use [tryCatch](https://github.com/coderaiser/try-catch), [tryToCatch](https://github.com/coderaiser/try-to-catch) with `equal` instead.
29
35
 
30
- `Supertape` was written from scratch after messing a lot with `tape`, it inspired by `tape` and willing to be compatible with it.
31
-
32
36
  ## Install
33
37
 
34
38
  ```
@@ -44,8 +48,8 @@ Options
44
48
  -v, --version output version information and exit
45
49
  -f, --format use a specific output format - default: progress-bar/tap on CI
46
50
  -r, --require require module
47
- --check-scopes check that messages contains scope: 'scope: message'
48
- --check-assertions-count check that assertion count is no more then 1
51
+ --no-check-scopes do not check that messages contains scope: 'scope: message'
52
+ --no-check-assertions-count do not check that assertion count is no more then 1
49
53
  --no-check-duplicates do not check messages for duplicates
50
54
  ```
51
55
 
@@ -63,20 +67,74 @@ test('tape: error', (t) => {
63
67
  });
64
68
  ```
65
69
 
66
- ## Codemod
70
+ ## 🤷 How to migrate from `tape`?
71
+
72
+ You can convert your codebase from `tape` to 📼`Supertape` with help of 🐊[`Putout`](https://github.com/coderaiser/putout), which has built-in [@putout/plugin-tape](https://github.com/coderaiser/putout/tree/master/packages/plugin-tape),
73
+ which has a lot of rules that helps to write tests.
74
+ Here is [result example](https://github.com/coderaiser/cloudcmd/commit/74d56f795d22e98937dce0641ee3c7514a79e9e6).
75
+
76
+ ## `ESLint` rules
77
+
78
+ [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#readme) has rules for 📼`Supertape`:
79
+
80
+ - ✅ [`remove-newline-before-t-end`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout/lib/tape-remove-newline-before-t-end#readme)
81
+ - ✅ [`add-newline-before-assertion`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout/lib/tape-add-newline-before-assertion#readme)
82
+ - ✅ [`add-newline-between-tests`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout/lib/tape-add-newline-between-tests#readme)
83
+
84
+ ## Operators
85
+
86
+ To simplify `supertape` core operators located in separate packages, called `operators`:
87
+
88
+ Here is a list of built-int operators:
89
+
90
+ | Package | Version |
91
+ |--------|-------|
92
+ | [`@supertape/operator-stub`](/packages/operator-stub) | [![npm](https://img.shields.io/npm/v/@supertape/operator-stub.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/operator-stub) |
93
+
94
+ ## Formatters
67
95
 
68
- You can convert your codebase from `tape` to `supertape` with help of a [putout](https://github.com/coderaiser/putout) and built-in [@putout/plugin-tape](https://github.com/coderaiser/putout/tree/master/packages/plugin-tape).
69
- Here is [example of a result](https://github.com/coderaiser/cloudcmd/commit/74d56f795d22e98937dce0641ee3c7514a79e9e6).
96
+ There is a list of built-int `formatters` to customize output:
97
+
98
+ | Package | Version |
99
+ |--------|-------|
100
+ | [`@supertape/formatter-tap`](/packages/formatter-tap) | [![npm](https://img.shields.io/npm/v/@supertape/formatter-tap.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/formatter-tap) |
101
+ | [`@supertape/formatter-fail`](/packages/formatter-fail) | [![npm](https://img.shields.io/npm/v/@supertape/formatter-fail.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/formatter-fail) |
102
+ | [`@supertape/formatter-short`](/packages/formatter-short) | [![npm](https://img.shields.io/npm/v/@supertape/formatter-short.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/formatter-short) |
103
+ | [`@supertape/formatter-progress-bar`](/packages/formatter-progress-bar) | [![npm](https://img.shields.io/npm/v/@supertape/formatter-progress-bar.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/formatter-progress-bar) |
104
+ | [`@supertape/formatter-json-lines`](/packages/formatter-json-lines) | [![npm](https://img.shields.io/npm/v/@supertape/formatter-json-lines.svg?maxAge=86400)](https://www.npmjs.com/package/@supertape/formatter-json-lines) |
70
105
 
71
106
  ## API
72
107
 
73
108
  ### Methods
74
109
 
75
- The assertion methods in `supertape` are heavily influenced or copied from the methods
76
- in [tape](https://github.com/substack/tape).
110
+ The assertion methods in `supertape` are heavily influenced by [tape](https://github.com/substack/tape).
77
111
 
78
112
  ```js
79
113
  const test = require('supertape');
114
+ const {sum} = require('./calc.js');
115
+
116
+ test('calc: sum', (t) => {
117
+ const result = sum(1, 2);
118
+ const expected = 3;
119
+
120
+ t.equal(result, expected);
121
+ t.end();
122
+ });
123
+ ```
124
+
125
+ or in `ESM`:
126
+
127
+ ```js
128
+ import {test} from 'supertape';
129
+ import {sum} from './calc.js';
130
+
131
+ test('calc: sum', (t) => {
132
+ const result = sum(1, 2);
133
+ const expected = 3;
134
+
135
+ t.equal(result, expected);
136
+ t.end();
137
+ });
80
138
  ```
81
139
 
82
140
  ## test(name, cb)
@@ -176,9 +234,8 @@ const test = require('supertape');
176
234
 
177
235
  test('lib: arguments', async (t) => {
178
236
  throw Error('hello');
179
- // will call t.fail() with an error
180
- // will call t.end()
181
- t.end();
237
+ // will call t.fail with an error
238
+ // will call t.end
182
239
  });
183
240
 
184
241
  test('lib: diff', (t) => {
package/help.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "-v, --version ": "output version information and exit",
4
4
  "-f, --format ": "use a specific output format - default: progress-bar/tap on CI",
5
5
  "-r, --require ": "require module",
6
- "--check-scopes ": "check that messages contains scope: 'scope: message'",
7
- "--check-assertions-count ": "check that assertion count is no more then 1",
6
+ "--no-check-scopes ": "do not check that messages contains scope: 'scope: message'",
7
+ "--no-check-assertions-count": "do not check that assertion count is no more then 1",
8
8
  "--no-check-duplicates ": "do not check messages for duplicates"
9
9
  }
package/lib/supertape.js CHANGED
@@ -34,8 +34,8 @@ const defaultOptions = {
34
34
  isStop: () => false,
35
35
  checkDuplicates: true,
36
36
  checkIfEnded: true,
37
- checkAssertionsCount: false,
38
- checkScopes: false,
37
+ checkAssertionsCount: true,
38
+ checkScopes: true,
39
39
  };
40
40
 
41
41
  function _createEmitter({quiet, format, getOperators, isStop}) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "6.12.1",
3
+ "version": "7.0.1",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
- "description": "📼 Supertape fastest simplest test runner with lots of formatters",
5
+ "description": "📼 Supertape simplest high speed test runner with superpowers",
6
6
  "homepage": "http://github.com/coderaiser/supertape",
7
7
  "main": "./lib/supertape.js",
8
8
  "exports": {
@@ -77,22 +77,22 @@
77
77
  "@iocmd/wait": "^1.0.0",
78
78
  "c8": "^7.3.5",
79
79
  "check-dts": "^0.6.5",
80
- "eslint": "^8.0.0-beta.0",
80
+ "eslint": "^8.0.0",
81
81
  "eslint-plugin-node": "^11.1.0",
82
82
  "eslint-plugin-putout": "^13.0.1",
83
- "madrun": "^8.0.0",
83
+ "madrun": "^9.0.0",
84
84
  "mock-require": "^3.0.2",
85
85
  "montag": "^1.0.0",
86
86
  "nodemon": "^2.0.2",
87
87
  "pullout": "^4.0.0",
88
- "putout": "^24.1.0",
88
+ "putout": "^25.0.0",
89
89
  "runsome": "^1.0.0",
90
90
  "try-catch": "^3.0.0",
91
91
  "typescript": "^4.4.4"
92
92
  },
93
93
  "license": "MIT",
94
94
  "engines": {
95
- "node": ">=14"
95
+ "node": ">=16"
96
96
  },
97
97
  "publishConfig": {
98
98
  "access": "public"