jest-watch-typeahead 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
## 0.6.1
|
2
|
+
|
3
|
+
### Fixes
|
4
|
+
|
5
|
+
- Provide exact pattern for selected test names
|
6
|
+
|
7
|
+
## 0.6.0
|
8
|
+
|
9
|
+
### Chore & Maintenance
|
10
|
+
|
11
|
+
- Update dependencies and drop Node 8 ([#35](https://github.com/jest-community/jest-watch-typeahead/pull/35))
|
12
|
+
|
13
|
+
## 0.5.0
|
14
|
+
|
15
|
+
### Chore & Maintenance
|
16
|
+
|
17
|
+
- Update dependencies
|
18
|
+
|
19
|
+
## 0.4.2
|
20
|
+
|
21
|
+
### Fixes
|
22
|
+
|
23
|
+
- Fix issue with overly trimmed basenames when formatting test paths ([#33](https://github.com/jest-community/jest-watch-typeahead/pull/33))
|
24
|
+
|
25
|
+
## 0.4.1
|
26
|
+
|
27
|
+
### Fixes
|
28
|
+
|
29
|
+
- Allow selecting tests and files containing regexp special characters ([#32](https://github.com/jest-community/jest-watch-typeahead/pull/32))
|
30
|
+
|
31
|
+
### Chore & Maintenance
|
32
|
+
|
33
|
+
- Remove build directory before building ([#31](https://github.com/jest-community/jest-watch-typeahead/pull/31))
|
34
|
+
|
1
35
|
## 0.4.0
|
2
36
|
|
3
37
|
### Chore & Maintenance
|
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
var _jestWatcher = require("jest-watcher");
|
4
4
|
|
5
|
-
var _jestRegexUtil = require("jest-regex-util");
|
6
|
-
|
7
5
|
var _prompt = _interopRequireDefault(require("./prompt"));
|
8
6
|
|
9
|
-
var _utils = require("../lib/utils");
|
10
|
-
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
8
|
|
13
9
|
class FileNamePlugin {
|
@@ -42,10 +38,10 @@ class FileNamePlugin {
|
|
42
38
|
const p = new _prompt.default(this._stdout, this._prompt);
|
43
39
|
p.updateSearchSources(this._projects);
|
44
40
|
return new Promise((res, rej) => {
|
45
|
-
p.run(
|
41
|
+
p.run(testPathPattern => {
|
46
42
|
updateConfigAndRun({
|
47
43
|
mode: 'watch',
|
48
|
-
testPathPattern
|
44
|
+
testPathPattern
|
49
45
|
});
|
50
46
|
res();
|
51
47
|
}, rej);
|
@@ -13,6 +13,8 @@ var _stringLength = _interopRequireDefault(require("string-length"));
|
|
13
13
|
|
14
14
|
var _jestWatcher = require("jest-watcher");
|
15
15
|
|
16
|
+
var _jestRegexUtil = require("jest-regex-util");
|
17
|
+
|
16
18
|
var _utils = require("../lib/utils");
|
17
19
|
|
18
20
|
var _pattern_mode_helpers = require("../lib/pattern_mode_helpers");
|
@@ -99,6 +101,12 @@ class FileNamePatternPrompt extends _jestWatcher.PatternPrompt {
|
|
99
101
|
this._searchSources = searchSources;
|
100
102
|
}
|
101
103
|
|
104
|
+
run(onSuccess, onCancel, options) {
|
105
|
+
super.run(value => {
|
106
|
+
onSuccess((0, _utils.removeTrimmingDots)(value).split('/').map(_jestRegexUtil.escapeStrForRegex).join('/'));
|
107
|
+
}, onCancel, options);
|
108
|
+
}
|
109
|
+
|
102
110
|
}
|
103
111
|
|
104
112
|
exports.default = FileNamePatternPrompt;
|
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
var _jestWatcher = require("jest-watcher");
|
4
4
|
|
5
|
-
var _jestRegexUtil = require("jest-regex-util");
|
6
|
-
|
7
5
|
var _prompt = _interopRequireDefault(require("./prompt"));
|
8
6
|
|
9
|
-
var _utils = require("../lib/utils");
|
10
|
-
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
8
|
|
13
9
|
class TestNamePlugin {
|
@@ -42,10 +38,10 @@ class TestNamePlugin {
|
|
42
38
|
const p = new _prompt.default(this._stdout, this._prompt);
|
43
39
|
p.updateCachedTestResults(this._testResults);
|
44
40
|
return new Promise((res, rej) => {
|
45
|
-
p.run(
|
41
|
+
p.run(testNamePattern => {
|
46
42
|
updateConfigAndRun({
|
47
43
|
mode: 'watch',
|
48
|
-
testNamePattern
|
44
|
+
testNamePattern
|
49
45
|
});
|
50
46
|
res();
|
51
47
|
}, rej);
|
@@ -6,6 +6,8 @@ var _ansiEscapes = _interopRequireDefault(require("ansi-escapes"));
|
|
6
6
|
|
7
7
|
var _jestWatcher = require("jest-watcher");
|
8
8
|
|
9
|
+
var _jestRegexUtil = require("jest-regex-util");
|
10
|
+
|
9
11
|
var _scroll2 = _interopRequireDefault(require("../lib/scroll"));
|
10
12
|
|
11
13
|
var _utils = require("../lib/utils");
|
@@ -19,11 +21,14 @@ class TestNamePatternPrompt extends _jestWatcher.PatternPrompt {
|
|
19
21
|
super(pipe, prompt);
|
20
22
|
this._entityName = 'tests';
|
21
23
|
this._cachedTestResults = [];
|
24
|
+
this._offset = -1;
|
22
25
|
}
|
23
26
|
|
24
27
|
_onChange(pattern, options) {
|
25
28
|
super._onChange(pattern, options);
|
26
29
|
|
30
|
+
this._offset = options.offset;
|
31
|
+
|
27
32
|
this._printTypeahead(pattern, options);
|
28
33
|
}
|
29
34
|
|
@@ -82,6 +87,14 @@ class TestNamePatternPrompt extends _jestWatcher.PatternPrompt {
|
|
82
87
|
this._cachedTestResults = testResults;
|
83
88
|
}
|
84
89
|
|
90
|
+
run(onSuccess, onCancel, options) {
|
91
|
+
super.run(value => {
|
92
|
+
const preparedPattern = (0, _jestRegexUtil.escapeStrForRegex)((0, _utils.removeTrimmingDots)(value));
|
93
|
+
const useExactMatch = this._offset !== -1;
|
94
|
+
onSuccess(useExactMatch ? `^${preparedPattern}$` : preparedPattern);
|
95
|
+
}, onCancel, options);
|
96
|
+
}
|
97
|
+
|
85
98
|
}
|
86
99
|
|
87
100
|
module.exports = TestNamePatternPrompt;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "jest-watch-typeahead",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.1",
|
4
4
|
"main": "build/index.js",
|
5
5
|
"author": "Rogelio Guzman <rogelioguzmanh@gmail.com>",
|
6
6
|
"description": "Jest plugin for filtering by filename or test name",
|
@@ -22,13 +22,13 @@
|
|
22
22
|
"prebuild": "rimraf build",
|
23
23
|
"build": "babel src --ignore **/*.test.js,integration -d build",
|
24
24
|
"prepublish": "yarn build",
|
25
|
-
"format": "prettier --write \"**/*.js\""
|
25
|
+
"format": "prettier --write \"**/*.js\" \"**/*.md\""
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
28
|
"ansi-escapes": "^4.3.1",
|
29
29
|
"chalk": "^4.0.0",
|
30
30
|
"jest-regex-util": "^26.0.0",
|
31
|
-
"jest-watcher": "^26.
|
31
|
+
"jest-watcher": "^26.3.0",
|
32
32
|
"slash": "^3.0.0",
|
33
33
|
"string-length": "^4.0.1",
|
34
34
|
"strip-ansi": "^6.0.0"
|
@@ -40,16 +40,16 @@
|
|
40
40
|
"@babel/preset-flow": "^7.9.0",
|
41
41
|
"babel-eslint": "^10.1.0",
|
42
42
|
"babel-jest": "^26.0.0",
|
43
|
-
"eslint": "^
|
43
|
+
"eslint": "^7.8.1",
|
44
44
|
"eslint-config-airbnb-base": "^14.1.0",
|
45
45
|
"eslint-config-prettier": "^6.11.0",
|
46
|
-
"eslint-plugin-flowtype": "^
|
46
|
+
"eslint-plugin-flowtype": "^5.2.0",
|
47
47
|
"eslint-plugin-import": "^2.20.2",
|
48
|
-
"eslint-plugin-jest": "^
|
48
|
+
"eslint-plugin-jest": "^24.0.0",
|
49
49
|
"eslint-plugin-prettier": "^3.1.3",
|
50
|
-
"flow-bin": "^0.
|
50
|
+
"flow-bin": "^0.133.0",
|
51
51
|
"jest": "^26.0.0",
|
52
|
-
"prettier": "2.
|
52
|
+
"prettier": "^2.1.1",
|
53
53
|
"rimraf": "^3.0.2"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|