Skip to content

Commit d7c1974

Browse files
authored
Merge pull request #209 from getsentry/bugfix/babel-preset
Fix babel-preset
2 parents bb59e9d + a198274 commit d7c1974

File tree

5 files changed

+48
-27
lines changed

5 files changed

+48
-27
lines changed

SentryReactNative.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Pod::Spec.new do |s|
1818
s.preserve_paths = '*.js'
1919

2020
s.dependency 'React'
21-
s.dependency 'Sentry', '~> 3.6.0'
22-
s.dependency 'Sentry/KSCrash', '~> 3.6.0'
21+
s.dependency 'Sentry', '~> 3.6.1'
22+
s.dependency 'Sentry/KSCrash', '~> 3.6.1'
2323

2424
s.source_files = 'ios/RNSentry*.{h,m}'
2525
s.public_header_files = 'ios/RNSentry.h'

appium/check_run_failues.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ def ios_check
4848
@problems.unique_problems.each do |up|
4949
raise RuntimeError, "No failed tests: #{up.inspect}" unless up.length == 2
5050
up[1].each do |p|
51-
if p.problems[0].test.name == 'test_throw_error'
51+
if p.problems[0].test.name == 'test_throw_error' || p.problems[0].test.name == 'test_native_crash'
5252
artifacts = @client.list_artifacts({
5353
type: "FILE",
5454
arn: p.problems[0].test.arn
5555
})
5656
artifacts.artifacts.each do |a|
5757
if a.name == 'Syslog'
5858
content = open(a.url).read
59-
raise RuntimeError, "No JSON SENT: #{p.inspect}" unless content.scan(/Sentry - Verbose:: Sending JSON/).size == 1
60-
raise RuntimeError, "Wrong exception value: #{p.inspect}" unless content.scan(/"value" : "Sentry: Test throw error"/).size == 1
61-
raise RuntimeError, "No javascript frames: #{p.inspect}" unless content.scan(/"platform" : "javascript"/).size >= 1
59+
if p.problems[0].test.name == 'test_throw_error'
60+
raise RuntimeError, "Sentry should start twice: #{p.inspect}" unless content.scan(/Sentry Started -- Version/).size == 2
61+
raise RuntimeError, "No JSON SENT: #{p.inspect}" unless content.scan(/Sentry - Debug:: Request status: 200/).size == 1
62+
elsif p.problems[0].test.name == 'test_native_crash'
63+
raise RuntimeError, "Sentry should start twice: #{p.inspect}" unless content.scan(/Sentry Started -- Version/).size == 2
64+
raise RuntimeError, "No JSON SENT: #{p.inspect}" unless content.scan(/Sentry - Debug:: Request status: 200/).size == 1
65+
raise RuntimeError, "exception_name should be EXC_BREAKPOINT: #{p.inspect}" unless content.scan(/"exception_name" : "EXC_BREAKPOINT"/).size == 1
66+
end
6267
end
6368
end
6469
end
65-
if p.problems[0].test.name == 'test_native_crash'
66-
exception = p.message.match(/crashed: EXC_/)
67-
raise RuntimeError, "No crash: #{p.inspect}" unless !exception.nil?
68-
exception = nil
69-
end
7070
end
7171
end
7272
end

appium/tests/test_ios.py

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,31 @@ def test_dist(driver):
5757
def test_throw_error(driver):
5858
driver.find_element_by_accessibility_id('throw error').click()
5959
driver.relaunch_app()
60+
sleep(3)
6061
value = extractText(driver)
61-
# the crash should have been already sent
62-
assert value is None
62+
assert value != None
63+
event = json.loads(value)
64+
65+
assert len(event['breadcrumbs']) > 0
66+
assert len(event['contexts']) > 0
67+
for thread in event['exception']['values']:
68+
assert len(thread['stacktrace']['frames']) > 0
69+
cocoa_frames = 0
70+
js_frames = 0
71+
for frame in thread['stacktrace']['frames']:
72+
if frame.get('package', None):
73+
cocoa_frames += 1
74+
if frame.get('platform', None) == 'javascript':
75+
js_frames += 1
76+
assert js_frames > 0
77+
assert len(event['exception']['values']) > 0
78+
assert event['exception']['values'][0]['value'] == "Sentry: Test throw error"
79+
assert event['exception']['values'][0]['type'] == "Error"
80+
assert event['platform'] == 'cocoa'
81+
assert event['level'] == 'fatal'
82+
assert event['extra']['react']
83+
assert event['tags']['react'] == '1'
84+
assert len(event['user']) > 0
6385

6486
def test_native_crash(driver):
6587
sleep(2)
@@ -74,20 +96,19 @@ def test_native_crash(driver):
7496
assert len(event['breadcrumbs']) > 0
7597
assert len(event['contexts']) > 0
7698
assert len(event['threads']['values']) > 0
77-
for thread in event['threads']['values']:
78-
if thread['crashed']:
79-
assert len(thread['stacktrace']['frames']) > 0
80-
cocoa_frames = 0
81-
js_frames = 0
82-
for frame in thread['stacktrace']['frames']:
83-
if frame.get('package', None):
84-
cocoa_frames += 1
85-
if frame.get('platform', None) == 'javascript':
86-
js_frames += 1
87-
assert cocoa_frames > 0
88-
assert js_frames > 0 # does not work in release build
99+
for thread in event['exception']['values']:
100+
assert len(thread['stacktrace']['frames']) > 0
101+
cocoa_frames = 0
102+
js_frames = 0
103+
for frame in thread['stacktrace']['frames']:
104+
if frame.get('package', None):
105+
cocoa_frames += 1
106+
if frame.get('platform', None) == 'javascript':
107+
js_frames += 1
108+
assert cocoa_frames > 0
89109
assert len(event['exception']['values']) > 0
90110
assert len(event['debug_meta']['images']) > 0
111+
assert event['exception']['values'][0]['value'] == 'crash'
91112
assert event['platform'] == 'cocoa'
92113
assert event['level'] == 'fatal'
93114
assert event['extra']['react']

examples

0 commit comments

Comments
 (0)