Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set to NSNumber
  • Loading branch information
buenaflor committed Nov 9, 2023
commit 70328c82fc2a37a5554c9fb575f992fadeeb2c05
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ internal fun CocoaSentryOptions.applyCocoaBaseOptions(options: SentryOptions) {
enableAutoSessionTracking = options.enableAutoSessionTracking
maxAttachmentSize = options.maxAttachmentSize.convert()
maxBreadcrumbs = options.maxBreadcrumbs.convert()
sampleRate = options.sampleRate as? NSNumber
tracesSampleRate = options.tracesSampleRate as? NSNumber
options.sampleRate?.let {
sampleRate = NSNumber(it)
}
options.tracesSampleRate?.let {
tracesSampleRate = NSNumber(it)
}
beforeSend = { event ->
val cocoaName = BuildKonfig.SENTRY_COCOA_PACKAGE_NAME
val cocoaVersion = BuildKonfig.SENTRY_COCOA_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlin.test.assertContentEquals
import kotlin.test.assertEquals

class FoundationTest {

@Test
fun `convert string to NSData and ByteArray is correct`() {
val text = "$!()I!(DKDASKDKSD(#(ldkiadjk91jd"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
package io.sentry.kotlin.multiplatform

import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
import io.sentry.kotlin.multiplatform.utils.fakeDsn
import kotlin.test.Test
import kotlin.test.assertEquals

class SentryOptionsTest {
class SentryOptionsTest : BaseSentryTest() {
@Test
fun `GIVEN sample rate WHEN set in Sentry init THEN does not crash`() {
// GIVEN
val sampleRate = 0.5

// WHEN
sentryInit {
it.dsn = fakeDsn
it.sampleRate = sampleRate
}

// THEN
// does not crash
}

@Test
fun `Breadcrumb can be modified via callback in init and should return the modified Breadcrumb`() {
Expand Down