File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,17 @@ export class TestRunsService {
4040 testVariation : TestVariation ;
4141 } > {
4242 const testRun = await this . findOne ( id ) ;
43+
44+ // remove old baseline
45+ if ( testRun . testVariation . baselineName ) {
46+ this . staticService . deleteImage ( testRun . testVariation . baselineName ) ;
47+ }
48+
49+ // save new baseline
50+ const baseline = this . staticService . getImage ( testRun . imageName )
51+ const imageName = `${ Date . now ( ) } .baseline.png` ;
52+ this . staticService . saveImage ( imageName , baseline . data ) ;
53+
4354 return this . prismaService . testRun . update ( {
4455 where : { id } ,
4556 include : {
@@ -49,7 +60,7 @@ export class TestRunsService {
4960 status : TestStatus . ok ,
5061 testVariation : {
5162 update : {
52- baselineName : testRun . imageName ,
63+ baselineName : imageName ,
5364 } ,
5465 } ,
5566 } ,
You can’t perform that action at this time.
0 commit comments