@7n/test 0.7.0 → 0.7.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.md +6 -0
- package/package.json +1 -1
- package/src/coverage-per-file.mjs +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.1] - 2026-06-27
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `parseFailingTests` тепер коректно обробляє module-level помилки (import/syntax errors) — тести, що падають ще до запуску (`assertionResults: []`), більше не пропускаються, що усувало нескінченну bootstrap-петлю.
|
|
8
|
+
|
|
3
9
|
## [0.7.0] - 2026-06-27
|
|
4
10
|
|
|
5
11
|
### Added
|
package/package.json
CHANGED
|
@@ -63,9 +63,8 @@ function parseFailingTests(jsonPath, dir) {
|
|
|
63
63
|
const data = JSON.parse(readFileSync(jsonPath, 'utf8'))
|
|
64
64
|
return (data.testResults ?? [])
|
|
65
65
|
.filter(r => r.status === 'failed')
|
|
66
|
-
.map(r =>
|
|
67
|
-
|
|
68
|
-
errors: (r.assertionResults ?? [])
|
|
66
|
+
.map(r => {
|
|
67
|
+
const assertionErrors = (r.assertionResults ?? [])
|
|
69
68
|
.filter(a => a.status === 'failed')
|
|
70
69
|
.slice(0, MAX_ERRORS_PER_FILE)
|
|
71
70
|
.map(a => {
|
|
@@ -73,8 +72,13 @@ function parseFailingTests(jsonPath, dir) {
|
|
|
73
72
|
const msg = (a.failureMessages?.[0] ?? '').split('\n').slice(0, MAX_ERROR_LINES).join('\n')
|
|
74
73
|
return `${name}:\n${msg}`
|
|
75
74
|
})
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
// Module-level errors (import/syntax) produce no assertionResults
|
|
76
|
+
const errors = assertionErrors.length > 0
|
|
77
|
+
? assertionErrors
|
|
78
|
+
: [`Suite error: ${(r.message ?? r.failureMessage ?? 'module-level failure').split('\n').slice(0, MAX_ERROR_LINES).join('\n')}`]
|
|
79
|
+
return { file: relative(dir, r.testFilePath), errors }
|
|
80
|
+
})
|
|
81
|
+
.filter(f => !f.file.startsWith('..'))
|
|
78
82
|
} catch {
|
|
79
83
|
return []
|
|
80
84
|
}
|