This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ $CI_XCODEBUILD_ACTION == "test-without-building" ]] | |
then | |
# Setup the simulators so that they only have one preferred language. | |
# This works around an issue where the simulators on Sonoma have multiple | |
# preferred languages which include Arabic and therefore provide different | |
# results when running snapshot tests. | |
# | |
# This solution was inspired by: https://stackoverflow.com/a/74335552 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ComposableArchitecture | |
import SwiftUI | |
public struct FlowRunner { | |
public static func run<State: Equatable, Action: Equatable>( | |
type: String, | |
store: Store<State, Action>, | |
initialView: some View, | |
initializationAction: FlowRunner.NamedAction<Action>, | |
actions: [FlowRunner.NamedAction<Action>], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
/// https://stackoverflow.com/a/26962452 | |
extension UIDevice { | |
static let modelName: String = { | |
var systemInfo = utsname() | |
uname(&systemInfo) | |
let machineMirror = Mirror(reflecting: systemInfo.machine) | |
let identifier = machineMirror.children.reduce("") { identifier, element in | |
guard let value = element.value as? Int8, value != 0 else { return identifier } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AccessibilitySnapshot | |
import SnapshotTesting | |
import SwiftUI | |
import XCTest | |
extension Snapshotting where Value == UIViewController, Format == UIImage { | |
fileprivate static func standardImage( | |
on viewImageConfig: ViewImageConfig, | |
perceptualPrecision: Float = 0.98, | |
precision: Float = 0.995 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright 2023 Block Inc. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |