From 9b8ad349d96b0329b42452921d280fdf0d53bc6c Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Thu, 19 Jul 2018 11:35:13 +0300 Subject: [PATCH] fix: replace ':' with '-' in generated dir for better fs compatibility --- .../utils/__snapshots__/getTimeStampString.test.js.snap | 2 +- detox/src/artifacts/utils/getTimeStampString.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/detox/src/artifacts/utils/__snapshots__/getTimeStampString.test.js.snap b/detox/src/artifacts/utils/__snapshots__/getTimeStampString.test.js.snap index 88464982fd..aa24117c5c 100644 --- a/detox/src/artifacts/utils/__snapshots__/getTimeStampString.test.js.snap +++ b/detox/src/artifacts/utils/__snapshots__/getTimeStampString.test.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`getTimeStampString should format date 1`] = `"2015-06-15 15:02:58Z"`; +exports[`getTimeStampString should format date 1`] = `"2015-06-15 15-02-58Z"`; diff --git a/detox/src/artifacts/utils/getTimeStampString.js b/detox/src/artifacts/utils/getTimeStampString.js index 218814b09c..fb687ac6a4 100644 --- a/detox/src/artifacts/utils/getTimeStampString.js +++ b/detox/src/artifacts/utils/getTimeStampString.js @@ -1,7 +1,8 @@ function getTimeStampString(date = new Date()) { return date.toISOString() .replace(/T/, ' ') - .replace(/\.\d{3}/, ''); + .replace(/\.\d{3}/, '') + .replace(/:/g, '-'); } module.exports = getTimeStampString;