@regressionproof/snapshotter 0.5.7 → 0.6.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/build/esm/snapshot.js +15 -1
- package/build/esm/snapshotter.types.d.ts +14 -0
- package/build/esm/sync.js +1 -1
- package/build/snapshot.js +14 -0
- package/build/snapshotter.types.d.ts +14 -0
- package/build/sync.js +1 -1
- package/package.json +2 -2
package/build/esm/snapshot.js
CHANGED
|
@@ -55,5 +55,19 @@ export function snapshot(options) {
|
|
|
55
55
|
function sortTestResults(testResults) {
|
|
56
56
|
const suites = [...testResults.suites].map((suite) => (Object.assign(Object.assign({}, suite), { tests: [...suite.tests].sort((left, right) => left.name.localeCompare(right.name)) })));
|
|
57
57
|
suites.sort((left, right) => left.path.localeCompare(right.path));
|
|
58
|
-
|
|
58
|
+
const typeErrors = testResults.typeErrors
|
|
59
|
+
? [...testResults.typeErrors].sort((left, right) => {
|
|
60
|
+
const fileCompare = left.file.localeCompare(right.file);
|
|
61
|
+
if (fileCompare !== 0) {
|
|
62
|
+
return fileCompare;
|
|
63
|
+
}
|
|
64
|
+
const lineCompare = left.line - right.line;
|
|
65
|
+
if (lineCompare !== 0) {
|
|
66
|
+
return lineCompare;
|
|
67
|
+
}
|
|
68
|
+
return left.column - right.column;
|
|
69
|
+
})
|
|
70
|
+
: undefined;
|
|
71
|
+
return Object.assign(Object.assign({}, testResults), { suites,
|
|
72
|
+
typeErrors });
|
|
59
73
|
}
|
|
@@ -6,6 +6,18 @@ export interface TestResult {
|
|
|
6
6
|
/** Full error message + callstack (only present if failed) */
|
|
7
7
|
error?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface TypeCheckError {
|
|
10
|
+
/** File path relative to project root */
|
|
11
|
+
file: string;
|
|
12
|
+
/** Line number (1-indexed) */
|
|
13
|
+
line: number;
|
|
14
|
+
/** Column number (1-indexed) */
|
|
15
|
+
column: number;
|
|
16
|
+
/** TypeScript error code (e.g., "TS2322") */
|
|
17
|
+
code: string;
|
|
18
|
+
/** Error message */
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
9
21
|
export interface SuiteResult {
|
|
10
22
|
/** Path to test file, relative to project root */
|
|
11
23
|
path: string;
|
|
@@ -35,6 +47,8 @@ export interface TestResults {
|
|
|
35
47
|
summary: TestResultsSummary;
|
|
36
48
|
/** Array of suite results */
|
|
37
49
|
suites: SuiteResult[];
|
|
50
|
+
/** TypeScript type check errors (only present if project has tsconfig.json) */
|
|
51
|
+
typeErrors?: TypeCheckError[];
|
|
38
52
|
}
|
|
39
53
|
export interface RemoteOptions {
|
|
40
54
|
/** Gitea repo URL to push to */
|
package/build/esm/sync.js
CHANGED
|
@@ -29,7 +29,7 @@ export function syncFiles(sourcePath, mirrorPath) {
|
|
|
29
29
|
const hasGitIgnore = existsSync(path.join(sourcePath, '.gitignore'));
|
|
30
30
|
const excludes = DEFAULT_EXCLUDES.map((e) => `--exclude='${e}'`).join(' ');
|
|
31
31
|
if (hasGitIgnore) {
|
|
32
|
-
const cmd = `cd "${sourcePath}" && git ls-files --cached --others --exclude-standard -z | rsync -av --files-from=- --from0 ${excludes} . "${mirrorPath}/"`;
|
|
32
|
+
const cmd = `cd "${sourcePath}" && git ls-files --cached --others --exclude-standard -z | rsync -av --ignore-missing-args --files-from=- --from0 ${excludes} . "${mirrorPath}/"`;
|
|
33
33
|
yield execAsync(cmd);
|
|
34
34
|
}
|
|
35
35
|
else {
|
package/build/snapshot.js
CHANGED
|
@@ -50,8 +50,22 @@ function sortTestResults(testResults) {
|
|
|
50
50
|
tests: [...suite.tests].sort((left, right) => left.name.localeCompare(right.name)),
|
|
51
51
|
}));
|
|
52
52
|
suites.sort((left, right) => left.path.localeCompare(right.path));
|
|
53
|
+
const typeErrors = testResults.typeErrors
|
|
54
|
+
? [...testResults.typeErrors].sort((left, right) => {
|
|
55
|
+
const fileCompare = left.file.localeCompare(right.file);
|
|
56
|
+
if (fileCompare !== 0) {
|
|
57
|
+
return fileCompare;
|
|
58
|
+
}
|
|
59
|
+
const lineCompare = left.line - right.line;
|
|
60
|
+
if (lineCompare !== 0) {
|
|
61
|
+
return lineCompare;
|
|
62
|
+
}
|
|
63
|
+
return left.column - right.column;
|
|
64
|
+
})
|
|
65
|
+
: undefined;
|
|
53
66
|
return {
|
|
54
67
|
...testResults,
|
|
55
68
|
suites,
|
|
69
|
+
typeErrors,
|
|
56
70
|
};
|
|
57
71
|
}
|
|
@@ -6,6 +6,18 @@ export interface TestResult {
|
|
|
6
6
|
/** Full error message + callstack (only present if failed) */
|
|
7
7
|
error?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface TypeCheckError {
|
|
10
|
+
/** File path relative to project root */
|
|
11
|
+
file: string;
|
|
12
|
+
/** Line number (1-indexed) */
|
|
13
|
+
line: number;
|
|
14
|
+
/** Column number (1-indexed) */
|
|
15
|
+
column: number;
|
|
16
|
+
/** TypeScript error code (e.g., "TS2322") */
|
|
17
|
+
code: string;
|
|
18
|
+
/** Error message */
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
9
21
|
export interface SuiteResult {
|
|
10
22
|
/** Path to test file, relative to project root */
|
|
11
23
|
path: string;
|
|
@@ -35,6 +47,8 @@ export interface TestResults {
|
|
|
35
47
|
summary: TestResultsSummary;
|
|
36
48
|
/** Array of suite results */
|
|
37
49
|
suites: SuiteResult[];
|
|
50
|
+
/** TypeScript type check errors (only present if project has tsconfig.json) */
|
|
51
|
+
typeErrors?: TypeCheckError[];
|
|
38
52
|
}
|
|
39
53
|
export interface RemoteOptions {
|
|
40
54
|
/** Gitea repo URL to push to */
|
package/build/sync.js
CHANGED
|
@@ -25,7 +25,7 @@ async function syncFiles(sourcePath, mirrorPath) {
|
|
|
25
25
|
const hasGitIgnore = (0, fs_1.existsSync)(path_1.default.join(sourcePath, '.gitignore'));
|
|
26
26
|
const excludes = DEFAULT_EXCLUDES.map((e) => `--exclude='${e}'`).join(' ');
|
|
27
27
|
if (hasGitIgnore) {
|
|
28
|
-
const cmd = `cd "${sourcePath}" && git ls-files --cached --others --exclude-standard -z | rsync -av --files-from=- --from0 ${excludes} . "${mirrorPath}/"`;
|
|
28
|
+
const cmd = `cd "${sourcePath}" && git ls-files --cached --others --exclude-standard -z | rsync -av --ignore-missing-args --files-from=- --from0 ${excludes} . "${mirrorPath}/"`;
|
|
29
29
|
await execAsync(cmd);
|
|
30
30
|
}
|
|
31
31
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regressionproof/snapshotter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"@sprucelabs/spruce-core-schemas": "^42.1.3",
|
|
95
95
|
"@sprucelabs/spruce-skill-utils": "^34.0.3"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "5727f8050f30a078b6919d331f5bb1c5df72db40"
|
|
98
98
|
}
|