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 e8d4fcb commit 040d02c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ function zipArtifacts(runCfg: RunnerConfig | CucumberRunnerConfig) {
if (!runCfg.artifacts || !runCfg.artifacts.retain) {
return;
}
Object.keys(runCfg.artifacts.retain).forEach((source) => {
const dest = path.join(runCfg.assetsDir, runCfg.artifacts.retain[source]);
const archivesMap = runCfg.artifacts.retain;
Object.keys(archivesMap).forEach((source) => {
const dest = path.join(runCfg.assetsDir, archivesMap[source]);
try {
zip(path.dirname(runCfg.path), source, dest);
} catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface CucumberRunnerConfig {
path: string;
preExecTimeout: number;
projectPath: string;
artifacts: Artifacts;
artifacts?: Artifacts;
}

export interface CucumberSuite {
Expand All @@ -103,7 +103,7 @@ export interface CucumberSuite {
}

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

0 comments on commit 040d02c

Please sign in to comment.