diff --git a/src/index.js b/src/index.js index f94eeed..70fb192 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) { @@ -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;