Skip to content

Commit

Permalink
make artifacts optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Mar 19, 2024
1 parent 23e7ec6 commit 8206cd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/testcafe-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ function zipArtifacts(runCfg: TestCafeConfig) {
if (!runCfg.artifacts || !runCfg.artifacts.retain) {
return;
}
Object.keys(runCfg.artifacts.retain).forEach((source) => {
const dest = path.join(runCfg.assetsPath, runCfg.artifacts.retain[source]);
const archivesMap = runCfg.artifacts.retain;
Object.keys(archivesMap).forEach((source) => {
const dest = path.join(runCfg.assetsPath, archivesMap[source]);
try {
zip(path.dirname(runCfg.path), source, dest);
} catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ export type TestCafeConfig = {
version: string;
configFile?: string;
};
artifacts: Artifacts;
artifacts?: Artifacts;
};

export type Artifacts = {
retain: {
retain?: {
[key: string]: string;
};
};

0 comments on commit 8206cd3

Please sign in to comment.