From cd877711d0520e4dde6413af69029aac543a2447 Mon Sep 17 00:00:00 2001 From: stanimir-georgiev Date: Mon, 30 Mar 2020 19:13:26 +0200 Subject: [PATCH 1/2] Add option to remove postfix index --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f94eeed..98eef0c 100644 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,7 @@ export default class Differencify { } this.configuration = sanitiseGlobalConfiguration(conf); this.browser = null; - this.testId = 0; + conf.removePostFix === true ? this.testId = undefined : this.testId = 0 } async launchBrowser(options) { From 0205e1a09218d51b2f790c3f5d6127d9883a62a6 Mon Sep 17 00:00:00 2001 From: stanimir-georgiev Date: Thu, 2 Apr 2020 02:06:53 +0200 Subject: [PATCH 2/2] Add option to remove the postfix index --- src/index.js | 4 +++- src/sanitiser.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 98eef0c..70fb192 100644 --- a/src/index.js +++ b/src/index.js @@ -57,7 +57,9 @@ export default class Differencify { } init(config) { - this.testId += 1; + if (this.testId !== undefined) { + this.testId += 1; + } const testConfig = sanitiseTestConfiguration(config, this.testId); if (testConfig.isUpdate) { logger.warn('Your tests are running on update mode. Test screenshots will be updated'); diff --git a/src/sanitiser.js b/src/sanitiser.js index d864b9b..103c3c3 100644 --- a/src/sanitiser.js +++ b/src/sanitiser.js @@ -28,7 +28,9 @@ const sanitiseTestConfiguration = (conf, testId) => { configuration.testName = configuration.testNameProvided ? conf.testName : testConfig.testName; - configuration.testId = testId; + if (testId !== undefined) { + configuration.testId = testId; + } configuration.isUpdate = (process.env.update && process.env.update === 'true') ? process.env.update : testConfig.isUpdate;