Skip to content

Commit db07846

Browse files
authored
Merge branch 'master' into bugfix/4760-Swift-Briding
2 parents 87f48f3 + 519459e commit db07846

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

detox/ios/Detox/Actions/NSObject+DetoxActions.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,12 @@ - (NSURL *)dtx_takeScreenshot:(nullable NSString*)name
627627
{
628628
UIImage *image = [self.dtx_view dtx_imageFromView];
629629
NSURL *path = [NSURL elementsScreenshotPath];
630-
NSString *fileName = [NSString stringWithFormat:@"ImageScreenshot_%@.png", name != nil ? name : self];
630+
NSString *fileName;
631+
if (name != nil) {
632+
fileName = [NSString stringWithFormat:@"ImageScreenshot_%@.png", name];
633+
} else {
634+
fileName = [NSString stringWithFormat:@"ImageScreenshot_%p.png", self];
635+
}
631636
[image dtx_saveToPath:path fileName:fileName];
632637

633638
return [path URLByAppendingPathComponent:fileName isDirectory:false];;

detox/src/configuration/loadExternalConfig.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ describe('loadExternalConfig', () => {
105105
await expect(loadExternalConfig({ cwd: DIR_BADCONFIG })).rejects.toThrow('something-that-does-not-exist');
106106
});
107107

108-
it('should fall back to fs-based config path resolution', () => {
108+
it('should fall back to fs-based config path resolution', async () => {
109109
const absoluteConfigPath = path.join(DIR_PRIORITY, 'detox-config.json');
110110
const relativeConfigPath = path.relative(process.cwd(), absoluteConfigPath);
111111

112-
const absoluteConfig = loadExternalConfig({ configPath: absoluteConfigPath });
112+
const absoluteConfig = await loadExternalConfig({ configPath: absoluteConfigPath });
113113
expect(logger.warn).not.toHaveBeenCalled();
114-
const relativeConfig = loadExternalConfig({ configPath: relativeConfigPath });
114+
const relativeConfig = await loadExternalConfig({ configPath: relativeConfigPath });
115115
expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('legacy filesystem'));
116116

117117
expect(absoluteConfig).toEqual(relativeConfig);

0 commit comments

Comments
 (0)