diff --git a/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt b/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt index d752ff8c..dcc48578 100644 --- a/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt +++ b/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt @@ -30,7 +30,7 @@ fun TextRowWithIcon( @FontScalePreviews @Composable fun TextRowWithIconPreviewFromMain() { - throw IllegalStateException("This should not be called") + error("This should not be called") TextRowWithIcon( titleText = stringResource(com.emergetools.snapshots.sample.R.string.sample_title), subtitleText = stringResource(com.emergetools.snapshots.sample.R.string.sample_subtitle) diff --git a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/SnapshotImageMetadata.kt b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/SnapshotImageMetadata.kt index ef1fd87b..20415c85 100644 --- a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/SnapshotImageMetadata.kt +++ b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/SnapshotImageMetadata.kt @@ -21,8 +21,6 @@ sealed class SnapshotMetadata { internal data class SnapshotImageMetadata( // Used as the primary key override val name: String, - @Deprecated("Use name instead") - val keyName: String, // User defined name, or set to defaults by our backend override val displayName: String?, // Filename of the outputted image @@ -32,7 +30,7 @@ internal data class SnapshotImageMetadata( override val type: SnapshotType, // Compose-specific metadata, only set if type == COMPOSABLE override val composePreviewSnapshotConfig: ComposePreviewSnapshotConfig? = null, -): SnapshotMetadata() +) : SnapshotMetadata() @Serializable internal data class SnapshotErrorMetadata( @@ -45,4 +43,4 @@ internal data class SnapshotErrorMetadata( override val type: SnapshotType, // Compose-specific metadata, only set if type == COMPOSABLE override val composePreviewSnapshotConfig: ComposePreviewSnapshotConfig? = null, -): SnapshotMetadata() +) : SnapshotMetadata() diff --git a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt index cee5df7c..9a3db10b 100644 --- a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt +++ b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt @@ -6,8 +6,6 @@ import androidx.compose.ui.test.junit4.ComposeContentTestRule import androidx.compose.ui.test.junit4.createComposeRule import androidx.test.platform.app.InstrumentationRegistry import com.emergetools.snapshots.EmergeSnapshots -import com.emergetools.snapshots.SnapshotSaver -import com.emergetools.snapshots.SnapshotType import com.emergetools.snapshots.SnapshotType.COMPOSABLE import com.emergetools.snapshots.shared.ComposePreviewSnapshotConfig import com.emergetools.snapshots.shared.ComposeSnapshots @@ -54,6 +52,7 @@ class EmergeComposeSnapshotReflectiveParameterizedInvoker(private val previewCon val snapshotRule: EmergeSnapshots = EmergeSnapshots() @Test + @Suppress("TooGenericExceptionCaught") fun reflectiveComposableInvoker() { try { composeRule.setContent { @@ -69,10 +68,7 @@ class EmergeComposeSnapshotReflectiveParameterizedInvoker(private val previewCon SnapshotVariantProvider(previewConfig) { it.invoke(null, currentComposer, 0) } - } ?: run { - // TODO: Ryan look to write error to file for better debugging - error("Unable to find composable method: ${previewConfig.originalFqn}") - } + } ?: error("Unable to find composable method: ${previewConfig.originalFqn}") } snapshotRule.take(composeRule, previewConfig) } catch (e: Exception) {