projax 3.3.58 → 3.3.63
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 +10 -1
- package/dist/electron/preload.d.ts +1 -0
- package/dist/electron/renderer/assets/index-CmtZriN5.js +66 -0
- package/dist/electron/renderer/index.html +1 -1
- package/dist/electron/script-runner.js +52 -20
- package/dist/index.js +14 -10
- package/dist/prxi.js +877 -109
- package/dist/prxi.tsx +1249 -177
- package/dist/script-runner.js +52 -20
- package/package.json +1 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/core-bridge.ts.html +0 -292
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -191
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/core-bridge.ts.html +0 -292
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -191
- package/coverage/lcov-report/port-extractor.ts.html +0 -1174
- package/coverage/lcov-report/port-scanner.ts.html +0 -301
- package/coverage/lcov-report/port-utils.ts.html +0 -670
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/script-runner.ts.html +0 -3346
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/test-parser.ts.html +0 -799
- package/coverage/lcov.info +0 -1338
- package/coverage/port-extractor.ts.html +0 -1174
- package/coverage/port-scanner.ts.html +0 -301
- package/coverage/port-utils.ts.html +0 -670
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/script-runner.ts.html +0 -3346
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/test-parser.ts.html +0 -799
- package/dist/__tests__/core-bridge.test.d.ts +0 -1
- package/dist/__tests__/core-bridge.test.js +0 -135
- package/dist/__tests__/port-extractor.test.d.ts +0 -1
- package/dist/__tests__/port-extractor.test.js +0 -407
- package/dist/__tests__/port-scanner.test.d.ts +0 -1
- package/dist/__tests__/port-scanner.test.js +0 -170
- package/dist/__tests__/port-utils.test.d.ts +0 -1
- package/dist/__tests__/port-utils.test.js +0 -127
- package/dist/__tests__/script-runner.test.d.ts +0 -1
- package/dist/__tests__/script-runner.test.js +0 -491
- package/dist/__tests__/test-parser.test.d.ts +0 -1
- package/dist/__tests__/test-parser.test.js +0 -276
- package/dist/api/__tests__/database.test.d.ts +0 -2
- package/dist/api/__tests__/database.test.d.ts.map +0 -1
- package/dist/api/__tests__/database.test.js +0 -485
- package/dist/api/__tests__/database.test.js.map +0 -1
- package/dist/api/__tests__/routes.test.d.ts +0 -2
- package/dist/api/__tests__/routes.test.d.ts.map +0 -1
- package/dist/api/__tests__/routes.test.js +0 -484
- package/dist/api/__tests__/routes.test.js.map +0 -1
- package/dist/api/__tests__/scanner.test.d.ts +0 -2
- package/dist/api/__tests__/scanner.test.d.ts.map +0 -1
- package/dist/api/__tests__/scanner.test.js +0 -403
- package/dist/api/__tests__/scanner.test.js.map +0 -1
- package/dist/core/__tests__/database.test.d.ts +0 -1
- package/dist/core/__tests__/database.test.js +0 -557
- package/dist/core/__tests__/detector.test.d.ts +0 -1
- package/dist/core/__tests__/detector.test.js +0 -375
- package/dist/core/__tests__/index.test.d.ts +0 -1
- package/dist/core/__tests__/index.test.js +0 -469
- package/dist/core/__tests__/scanner.test.d.ts +0 -1
- package/dist/core/__tests__/scanner.test.js +0 -406
- package/dist/core/__tests__/settings.test.d.ts +0 -1
- package/dist/core/__tests__/settings.test.js +0 -280
- package/dist/electron/core/__tests__/database.test.d.ts +0 -1
- package/dist/electron/core/__tests__/database.test.js +0 -557
- package/dist/electron/core/__tests__/detector.test.d.ts +0 -1
- package/dist/electron/core/__tests__/detector.test.js +0 -375
- package/dist/electron/core/__tests__/index.test.d.ts +0 -1
- package/dist/electron/core/__tests__/index.test.js +0 -469
- package/dist/electron/core/__tests__/scanner.test.d.ts +0 -1
- package/dist/electron/core/__tests__/scanner.test.js +0 -406
- package/dist/electron/core/__tests__/settings.test.d.ts +0 -1
- package/dist/electron/core/__tests__/settings.test.js +0 -280
- package/jest.config.js +0 -26
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const test_parser_1 = require("../test-parser");
|
|
4
|
-
describe('test-parser', () => {
|
|
5
|
-
describe('parseTestOutput', () => {
|
|
6
|
-
describe('Jest output parsing', () => {
|
|
7
|
-
it('should parse basic Jest output with passed tests', () => {
|
|
8
|
-
// Jest output needs either (PASS && FAIL) or Test Suites:
|
|
9
|
-
const output = `
|
|
10
|
-
Test Suites: 1 passed, 1 total
|
|
11
|
-
Tests: 10 passed, 10 total
|
|
12
|
-
Time: 2.345 s
|
|
13
|
-
`;
|
|
14
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
15
|
-
expect(result).not.toBeNull();
|
|
16
|
-
expect(result?.framework).toBe('jest');
|
|
17
|
-
expect(result?.passed).toBe(10);
|
|
18
|
-
expect(result?.total).toBe(10);
|
|
19
|
-
expect(result?.duration).toBe(2345);
|
|
20
|
-
});
|
|
21
|
-
it('should parse Jest output with failed and passed tests', () => {
|
|
22
|
-
const output = `
|
|
23
|
-
Test Suites: 1 failed, 1 total
|
|
24
|
-
Tests: 3 failed, 7 passed, 10 total
|
|
25
|
-
Time: 1.5 s
|
|
26
|
-
`;
|
|
27
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
28
|
-
expect(result).not.toBeNull();
|
|
29
|
-
expect(result?.framework).toBe('jest');
|
|
30
|
-
expect(result?.failed).toBe(3);
|
|
31
|
-
expect(result?.passed).toBe(7);
|
|
32
|
-
});
|
|
33
|
-
it('should parse Jest output with skipped tests', () => {
|
|
34
|
-
const output = `
|
|
35
|
-
Test Suites: 1 passed, 1 total
|
|
36
|
-
Tests: 2 skipped, 8 passed, 10 total
|
|
37
|
-
Time: 1.0 s
|
|
38
|
-
`;
|
|
39
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
40
|
-
expect(result).not.toBeNull();
|
|
41
|
-
expect(result?.skipped).toBe(2);
|
|
42
|
-
expect(result?.passed).toBe(8);
|
|
43
|
-
});
|
|
44
|
-
it('should parse Jest output with total count', () => {
|
|
45
|
-
const output = `
|
|
46
|
-
Test Suites: 2 passed, 2 total
|
|
47
|
-
Tests: 5 failed, 10 passed, 15 total
|
|
48
|
-
Time: 3.0 s
|
|
49
|
-
`;
|
|
50
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
51
|
-
expect(result).not.toBeNull();
|
|
52
|
-
expect(result?.total).toBe(15);
|
|
53
|
-
expect(result?.failed).toBe(5);
|
|
54
|
-
expect(result?.passed).toBe(10);
|
|
55
|
-
});
|
|
56
|
-
it('should parse Jest output with coverage', () => {
|
|
57
|
-
const output = `
|
|
58
|
-
Test Suites: 1 passed, 1 total
|
|
59
|
-
Tests: 10 passed, 10 total
|
|
60
|
-
All files | 85.5
|
|
61
|
-
`;
|
|
62
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
63
|
-
expect(result).not.toBeNull();
|
|
64
|
-
expect(result?.coverage).toBe(85.5);
|
|
65
|
-
});
|
|
66
|
-
it('should identify Vitest output', () => {
|
|
67
|
-
const output = `
|
|
68
|
-
vitest run
|
|
69
|
-
Test Suites: 1 passed, 1 total
|
|
70
|
-
Tests: 10 passed, 10 total
|
|
71
|
-
Time: 1.0 s
|
|
72
|
-
`;
|
|
73
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
74
|
-
expect(result).not.toBeNull();
|
|
75
|
-
expect(result?.framework).toBe('vitest');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
describe('Mocha output parsing', () => {
|
|
79
|
-
it('should parse basic Mocha output', () => {
|
|
80
|
-
// Mocha detection: "passing" and "failing" must both be present
|
|
81
|
-
const output = `
|
|
82
|
-
10 passing (234ms)
|
|
83
|
-
0 failing
|
|
84
|
-
`;
|
|
85
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
86
|
-
expect(result).not.toBeNull();
|
|
87
|
-
expect(result?.framework).toBe('mocha');
|
|
88
|
-
expect(result?.passed).toBe(10);
|
|
89
|
-
expect(result?.duration).toBe(234);
|
|
90
|
-
});
|
|
91
|
-
it('should parse Mocha output with failures', () => {
|
|
92
|
-
const output = `
|
|
93
|
-
8 passing (500ms)
|
|
94
|
-
2 failing
|
|
95
|
-
`;
|
|
96
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
97
|
-
expect(result).not.toBeNull();
|
|
98
|
-
expect(result?.framework).toBe('mocha');
|
|
99
|
-
expect(result?.passed).toBe(8);
|
|
100
|
-
expect(result?.failed).toBe(2);
|
|
101
|
-
});
|
|
102
|
-
it('should parse Mocha output with pending tests', () => {
|
|
103
|
-
const output = `
|
|
104
|
-
7 passing (300ms)
|
|
105
|
-
1 pending
|
|
106
|
-
2 failing
|
|
107
|
-
`;
|
|
108
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
109
|
-
expect(result).not.toBeNull();
|
|
110
|
-
expect(result?.framework).toBe('mocha');
|
|
111
|
-
expect(result?.passed).toBe(7);
|
|
112
|
-
expect(result?.skipped).toBe(1);
|
|
113
|
-
expect(result?.failed).toBe(2);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
describe('pytest output parsing', () => {
|
|
117
|
-
it('should parse basic pytest output', () => {
|
|
118
|
-
// pytest detection: must include "passed" and "failed" and "pytest"
|
|
119
|
-
const output = `
|
|
120
|
-
pytest collected 10 items
|
|
121
|
-
===== 10 passed, 0 failed in 2.34s =====
|
|
122
|
-
`;
|
|
123
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
124
|
-
expect(result).not.toBeNull();
|
|
125
|
-
expect(result?.framework).toBe('pytest');
|
|
126
|
-
expect(result?.passed).toBe(10);
|
|
127
|
-
expect(result?.duration).toBe(2340);
|
|
128
|
-
});
|
|
129
|
-
it('should parse pytest output with failures', () => {
|
|
130
|
-
const output = `
|
|
131
|
-
pytest collected 10 items
|
|
132
|
-
===== 8 passed, 2 failed in 1.5s =====
|
|
133
|
-
`;
|
|
134
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
135
|
-
expect(result).not.toBeNull();
|
|
136
|
-
expect(result?.framework).toBe('pytest');
|
|
137
|
-
expect(result?.passed).toBe(8);
|
|
138
|
-
expect(result?.failed).toBe(2);
|
|
139
|
-
});
|
|
140
|
-
it('should parse pytest output with skipped tests', () => {
|
|
141
|
-
const output = `
|
|
142
|
-
pytest collected 10 items
|
|
143
|
-
===== 7 passed, 1 failed, 2 skipped in 3.0s =====
|
|
144
|
-
`;
|
|
145
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
146
|
-
expect(result).not.toBeNull();
|
|
147
|
-
expect(result?.passed).toBe(7);
|
|
148
|
-
expect(result?.failed).toBe(1);
|
|
149
|
-
expect(result?.skipped).toBe(2);
|
|
150
|
-
});
|
|
151
|
-
it('should parse pytest output with coverage', () => {
|
|
152
|
-
const output = `
|
|
153
|
-
pytest collected 10 items
|
|
154
|
-
===== 10 passed, 0 failed in 1.0s =====
|
|
155
|
-
TOTAL 100 20 80%
|
|
156
|
-
`;
|
|
157
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
158
|
-
expect(result).not.toBeNull();
|
|
159
|
-
expect(result?.coverage).toBe(80);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
describe('Python unittest output parsing', () => {
|
|
163
|
-
it('should parse successful unittest output', () => {
|
|
164
|
-
// unittest detection: "OK" and "test" in output
|
|
165
|
-
const output = `
|
|
166
|
-
test_something (test_module.TestClass) ... ok
|
|
167
|
-
Ran 15 tests in 2.345s
|
|
168
|
-
|
|
169
|
-
OK
|
|
170
|
-
`;
|
|
171
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
172
|
-
expect(result).not.toBeNull();
|
|
173
|
-
expect(result?.framework).toBe('unittest');
|
|
174
|
-
expect(result?.total).toBe(15);
|
|
175
|
-
expect(result?.passed).toBe(15);
|
|
176
|
-
expect(result?.failed).toBe(0);
|
|
177
|
-
expect(result?.duration).toBe(2345);
|
|
178
|
-
});
|
|
179
|
-
// Note: The parser uses "OK" to detect unittest, so it can only detect successful unittest runs.
|
|
180
|
-
// Failed unittest runs (with "FAILED") are not detected as unittest by the current parser logic.
|
|
181
|
-
// This is a known limitation of the parser's detection algorithm.
|
|
182
|
-
it('should handle partial unittest success', () => {
|
|
183
|
-
// unittest with some tests passed but overall OK
|
|
184
|
-
const output = `
|
|
185
|
-
test_one (test_module.TestClass) ... ok
|
|
186
|
-
test_two (test_module.TestClass) ... ok
|
|
187
|
-
Ran 2 tests in 0.5s
|
|
188
|
-
|
|
189
|
-
OK
|
|
190
|
-
`;
|
|
191
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
192
|
-
expect(result).not.toBeNull();
|
|
193
|
-
expect(result?.framework).toBe('unittest');
|
|
194
|
-
expect(result?.total).toBe(2);
|
|
195
|
-
expect(result?.passed).toBe(2);
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
describe('Generic output parsing', () => {
|
|
199
|
-
it('should parse generic output with test/spec counts', () => {
|
|
200
|
-
const output = `
|
|
201
|
-
5 tests passed
|
|
202
|
-
2 tests failed
|
|
203
|
-
`;
|
|
204
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
205
|
-
expect(result).not.toBeNull();
|
|
206
|
-
expect(result?.framework).toBe('unknown');
|
|
207
|
-
expect(result?.passed).toBe(5);
|
|
208
|
-
expect(result?.failed).toBe(2);
|
|
209
|
-
});
|
|
210
|
-
it('should parse generic output with checkmarks', () => {
|
|
211
|
-
const output = `
|
|
212
|
-
✓ 10
|
|
213
|
-
✗ 2
|
|
214
|
-
`;
|
|
215
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
216
|
-
expect(result).not.toBeNull();
|
|
217
|
-
expect(result?.passed).toBe(10);
|
|
218
|
-
expect(result?.failed).toBe(2);
|
|
219
|
-
});
|
|
220
|
-
it('should return null for empty output', () => {
|
|
221
|
-
const result = (0, test_parser_1.parseTestOutput)('');
|
|
222
|
-
expect(result).toBeNull();
|
|
223
|
-
});
|
|
224
|
-
it('should return null for output with no test results', () => {
|
|
225
|
-
const result = (0, test_parser_1.parseTestOutput)('Some random log output\nNo test results here');
|
|
226
|
-
expect(result).toBeNull();
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
describe('Edge cases', () => {
|
|
230
|
-
it('should handle output with only whitespace', () => {
|
|
231
|
-
const result = (0, test_parser_1.parseTestOutput)(' \n\n\t ');
|
|
232
|
-
expect(result).toBeNull();
|
|
233
|
-
});
|
|
234
|
-
it('should calculate total when not provided', () => {
|
|
235
|
-
const output = `
|
|
236
|
-
Test Suites: 1 passed, 1 total
|
|
237
|
-
Tests: 3 failed, 2 skipped, 5 passed
|
|
238
|
-
`;
|
|
239
|
-
const result = (0, test_parser_1.parseTestOutput)(output);
|
|
240
|
-
expect(result).not.toBeNull();
|
|
241
|
-
// Total should be calculated: 3 + 2 + 5 = 10
|
|
242
|
-
expect(result?.total).toBeGreaterThanOrEqual(result.passed + result.failed + result.skipped);
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
describe('isTestOutput', () => {
|
|
247
|
-
it('should return true for Jest output', () => {
|
|
248
|
-
expect((0, test_parser_1.isTestOutput)('Test Suites: 1 passed')).toBe(true);
|
|
249
|
-
expect((0, test_parser_1.isTestOutput)('Tests: 5 passed')).toBe(true);
|
|
250
|
-
expect((0, test_parser_1.isTestOutput)('PASS src/test.ts')).toBe(true);
|
|
251
|
-
expect((0, test_parser_1.isTestOutput)('FAIL src/test.ts')).toBe(true);
|
|
252
|
-
});
|
|
253
|
-
it('should return true for Mocha output', () => {
|
|
254
|
-
expect((0, test_parser_1.isTestOutput)('10 passing')).toBe(true);
|
|
255
|
-
expect((0, test_parser_1.isTestOutput)('2 failing')).toBe(true);
|
|
256
|
-
});
|
|
257
|
-
it('should return true for pytest output', () => {
|
|
258
|
-
expect((0, test_parser_1.isTestOutput)('pytest collected 10 items')).toBe(true);
|
|
259
|
-
expect((0, test_parser_1.isTestOutput)('5 passed')).toBe(true);
|
|
260
|
-
expect((0, test_parser_1.isTestOutput)('2 failed')).toBe(true);
|
|
261
|
-
});
|
|
262
|
-
it('should return true for unittest output', () => {
|
|
263
|
-
expect((0, test_parser_1.isTestOutput)('Ran 10 tests')).toBe(true);
|
|
264
|
-
});
|
|
265
|
-
it('should return true for generic test indicators', () => {
|
|
266
|
-
expect((0, test_parser_1.isTestOutput)('Running tests...')).toBe(true);
|
|
267
|
-
expect((0, test_parser_1.isTestOutput)('1 spec passed')).toBe(true);
|
|
268
|
-
expect((0, test_parser_1.isTestOutput)('2 skipped')).toBe(true);
|
|
269
|
-
});
|
|
270
|
-
it('should return false for non-test output', () => {
|
|
271
|
-
expect((0, test_parser_1.isTestOutput)('Building project...')).toBe(false);
|
|
272
|
-
expect((0, test_parser_1.isTestOutput)('Compilation successful')).toBe(false);
|
|
273
|
-
expect((0, test_parser_1.isTestOutput)('')).toBe(false);
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"database.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/database.test.ts"],"names":[],"mappings":""}
|