1+ Feature : @bugsnag/plugin-cloudflare-workers
2+
3+ Scenario : A handled error
4+ When I start the worker "cloudflare-worker"
5+ And I wait for the host "localhost" to open port "8787"
6+ Then I open the URL "http://localhost:8787/handled?a=1&b=2" and get a 200 response with body "Hello World!"
7+
8+ Then I wait to receive a session
9+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
10+
11+ Then I wait to receive an error
12+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
13+ And the event "unhandled" is false
14+ And the event "severity" equals "warning"
15+ And the exception "errorClass" equals "Error"
16+ And the exception "message" equals "handled"
17+ And the exception "type" equals "nodejs"
18+ And the "file" of stack frame 0 matches "index.js"
19+ And the event "request.url" equals "http://localhost:8787/handled?a=1&b=2"
20+ And the event "request.httpMethod" equals "GET"
21+ And the event "request.clientIp" is not null
22+ And the event "request.headers" is not null
23+ And the event "metaData.request.path" equals "/handled"
24+ And the event "metaData.request.query.a" equals "1"
25+ And the event "metaData.request.query.b" equals "2"
26+
27+ Scenario : An unhandled error
28+ When I start the worker "cloudflare-worker"
29+ And I wait for the host "localhost" to open port "8787"
30+ Then I open the URL "http://localhost:8787/unhandled?a=1&b=2" and get a 500 response
31+
32+ Then I wait to receive a session
33+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
34+
35+ Then I wait to receive an error
36+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
37+ And the event "unhandled" is true
38+ And the event "severity" equals "error"
39+ And the exception "errorClass" equals "Error"
40+ And the exception "message" equals "unhandled"
41+ And the exception "type" equals "nodejs"
42+ And the "file" of stack frame 0 matches "index.js"
43+ And the event "request.url" equals "http://localhost:8787/unhandled?a=1&b=2"
44+ And the event "request.httpMethod" equals "GET"
45+ And the event "request.clientIp" is not null
46+ And the event "request.headers" is not null
47+ And the event "metaData.request.path" equals "/unhandled"
48+ And the event "metaData.request.query.a" equals "1"
49+ And the event "metaData.request.query.b" equals "2"
50+
51+ Scenario : Metadata from one request do not appear in another
52+ When I start the worker "cloudflare-worker"
53+ And I wait for the host "localhost" to open port "8787"
54+ Then I open the URL "http://localhost:8787/metadata_a" and get a 200 response with body "Hello World!"
55+
56+ Then I wait to receive a session
57+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
58+
59+ Then I wait to receive an error
60+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
61+ And the event "unhandled" is false
62+ And the event "severity" equals "warning"
63+ And the exception "errorClass" equals "Error"
64+ And the exception "message" equals "Metadata A Error"
65+ And the exception "type" equals "nodejs"
66+ And the "file" of stack frame 0 matches "index.js"
67+ And the event "request.url" equals "http://localhost:8787/metadata_a"
68+ And the event "request.httpMethod" equals "GET"
69+ And the event "request.clientIp" is not null
70+ And the event "request.headers" is not null
71+ And the event "metaData.request.path" equals "/metadata_a"
72+ And the event "metaData.Metadata A" is not null
73+ And the event "metaData.Metadata B" is null
74+
75+ And I discard the oldest session
76+ And I discard the oldest error
77+
78+ And I open the URL "http://localhost:8787/metadata_b" and get a 200 response with body "Hello World!"
79+
80+ And I wait to receive a session
81+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
82+
83+ And I wait to receive an error
84+ And the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
85+ And the event "unhandled" is false
86+ And the event "severity" equals "warning"
87+ And the exception "errorClass" equals "Error"
88+ And the exception "message" equals "Metadata B Error"
89+ And the exception "type" equals "nodejs"
90+ And the "file" of stack frame 0 matches "index.js"
91+ And the event "request.url" equals "http://localhost:8787/metadata_b"
92+ And the event "request.httpMethod" equals "GET"
93+ And the event "request.clientIp" is not null
94+ And the event "request.headers" is not null
95+ And the event "metaData.request.path" equals "/metadata_b"
96+ And the event "metaData.Metadata A" is null
97+ And the event "metaData.Metadata B" is not null
98+
99+ Scenario : Breadcrumbs from one request do not appear in another
100+ When I start the worker "cloudflare-worker"
101+ And I wait for the host "localhost" to open port "8787"
102+ Then I open the URL "http://localhost:8787/breadcrumbs_a" and get a 200 response with body "Hello World!"
103+
104+ Then I wait to receive a session
105+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
106+
107+ Then I wait to receive an error
108+ Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
109+ And the exception "message" equals "Breadcrumb A Error"
110+ And the event "request.url" equals "http://localhost:8787/breadcrumbs_a"
111+ And the event "request.httpMethod" equals "GET"
112+ And the event "request.clientIp" is not null
113+ And the event has a "manual" breadcrumb named "Breadcrumb A"
114+
115+ And I discard the oldest session
116+ And I discard the oldest error
117+
118+ And I open the URL "http://localhost:8787/breadcrumbs_b" and get a 200 response with body "Hello World!"
119+
120+ And I wait to receive a session
121+ And the session is valid for the session reporting API version "1" for the "Bugsnag Node" notifier
122+
123+ And I wait to receive an error
124+ And the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
125+ And the exception "message" equals "Breadcrumb B Error"
126+ And the event "request.url" equals "http://localhost:8787/breadcrumbs_b"
127+ And the event "request.httpMethod" equals "GET"
128+ And the event "request.clientIp" is not null
129+ And the event has a "manual" breadcrumb named "Breadcrumb B"
130+ And the event does not have a "manual" breadcrumb with message "Breadcrumb A"
0 commit comments