@flakiness/sdk 0.145.0 → 0.146.0
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/lib/{flakinessConfig.js → flakinessProjectConfig.js} +10 -17
- package/lib/playwright-test.js +243 -294
- package/lib/{cli/cmd-show-report.js → showReport.js} +37 -106
- package/package.json +14 -17
- package/types/tsconfig.tsbuildinfo +1 -1
- package/lib/cli/cli.js +0 -2382
- package/lib/cli/cmd-convert.js +0 -421
- package/lib/cli/cmd-download.js +0 -42
- package/lib/cli/cmd-link.js +0 -207
- package/lib/cli/cmd-login.js +0 -223
- package/lib/cli/cmd-logout.js +0 -170
- package/lib/cli/cmd-status.js +0 -273
- package/lib/cli/cmd-unlink.js +0 -199
- package/lib/cli/cmd-upload-playwright-json.js +0 -614
- package/lib/cli/cmd-upload.js +0 -321
- package/lib/cli/cmd-whoami.js +0 -173
- package/lib/flakinessSession.js +0 -159
- package/lib/junit.js +0 -310
- package/lib/playwrightJSONReport.js +0 -430
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/flakinessProjectConfig.ts
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path2 from "path";
|
|
4
4
|
|
|
@@ -123,7 +123,7 @@ function normalizePath(aPath) {
|
|
|
123
123
|
return aPath;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// src/
|
|
126
|
+
// src/flakinessProjectConfig.ts
|
|
127
127
|
function createConfigPath(dir) {
|
|
128
128
|
return path2.join(dir, ".flakiness", "config.json");
|
|
129
129
|
}
|
|
@@ -146,7 +146,7 @@ function computeConfigPath() {
|
|
|
146
146
|
return createConfigPath(process.cwd());
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
var
|
|
149
|
+
var FlakinessProjectConfig = class _FlakinessProjectConfig {
|
|
150
150
|
constructor(_configPath, _config) {
|
|
151
151
|
this._configPath = _configPath;
|
|
152
152
|
this._config = _config;
|
|
@@ -155,20 +155,10 @@ var FlakinessConfig = class _FlakinessConfig {
|
|
|
155
155
|
const configPath = ensureConfigPath();
|
|
156
156
|
const data = await fs.promises.readFile(configPath, "utf-8").catch((e) => void 0);
|
|
157
157
|
const json = data ? JSON.parse(data) : {};
|
|
158
|
-
return new
|
|
159
|
-
}
|
|
160
|
-
static async projectOrDie(session) {
|
|
161
|
-
const config = await _FlakinessConfig.load();
|
|
162
|
-
const projectPublicId = config.projectPublicId();
|
|
163
|
-
if (!projectPublicId)
|
|
164
|
-
throw new Error(`Please link to flakiness project with 'npx flakiness link'`);
|
|
165
|
-
const project = await session.api.project.getProject.GET({ projectPublicId }).catch((e) => void 0);
|
|
166
|
-
if (!project)
|
|
167
|
-
throw new Error(`Failed to fetch linked project; please re-link with 'npx flakiness link'`);
|
|
168
|
-
return project;
|
|
158
|
+
return new _FlakinessProjectConfig(configPath, json);
|
|
169
159
|
}
|
|
170
160
|
static createEmpty() {
|
|
171
|
-
return new
|
|
161
|
+
return new _FlakinessProjectConfig(ensureConfigPath(), {});
|
|
172
162
|
}
|
|
173
163
|
path() {
|
|
174
164
|
return this._configPath;
|
|
@@ -176,6 +166,9 @@ var FlakinessConfig = class _FlakinessConfig {
|
|
|
176
166
|
projectPublicId() {
|
|
177
167
|
return this._config.projectPublicId;
|
|
178
168
|
}
|
|
169
|
+
reportViewerEndpoint() {
|
|
170
|
+
return this._config.customReportViewerEndpoint ?? "https://report.flakiness.io";
|
|
171
|
+
}
|
|
179
172
|
setProjectPublicId(projectId) {
|
|
180
173
|
this._config.projectPublicId = projectId;
|
|
181
174
|
}
|
|
@@ -185,6 +178,6 @@ var FlakinessConfig = class _FlakinessConfig {
|
|
|
185
178
|
}
|
|
186
179
|
};
|
|
187
180
|
export {
|
|
188
|
-
|
|
181
|
+
FlakinessProjectConfig
|
|
189
182
|
};
|
|
190
|
-
//# sourceMappingURL=
|
|
183
|
+
//# sourceMappingURL=flakinessProjectConfig.js.map
|