@@ -23,6 +23,8 @@ test('simple', async ({ annotate }) => {
2323 await annotate('with base64 body', { body: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' })
2424 await annotate('with Uint8Array body', { body: new Uint8Array(Array.from({ length: 256 }).map((_, i) => i)) })
2525 await annotate('with contentType', { body: '', contentType: 'text/plain' })
26+ await annotate('bodyEncoding utf-8', { body: 'Hello world', bodyEncoding: 'utf-8', contentType: 'text/plain' })
27+ await annotate('bodyEncoding base64', { body: btoa('Hello world'), bodyEncoding: 'base64', contentType: 'text/plain' })
2628})
2729
2830describe('suite', () => {
@@ -112,6 +114,8 @@ describe('API', () => {
112114 "[annotate] simple with base64 body notice path=undefined contentType=undefined body=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
113115 "[annotate] simple with Uint8Array body notice path=undefined contentType=undefined body=AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
114116 "[annotate] simple with contentType notice path=undefined contentType=text/plain body=",
117+ "[annotate] simple bodyEncoding utf-8 notice path=undefined contentType=text/plain body=Hello world",
118+ "[annotate] simple bodyEncoding base64 notice path=undefined contentType=text/plain body=SGVsbG8gd29ybGQ=",
115119 "[result] simple",
116120 "[ready] second",
117121 "[annotate] second 5 notice path=undefined contentType=undefined body=undefined",
@@ -133,7 +137,7 @@ describe('API', () => {
133137 "location": {
134138 "column": 11,
135139 "file": "<root>/basic.test.ts",
136- "line": 18 ,
140+ "line": 20 ,
137141 },
138142 "message": "5",
139143 "type": "notice",
@@ -145,7 +149,7 @@ describe('API', () => {
145149 "location": {
146150 "column": 11,
147151 "file": "<root>/basic.test.ts",
148- "line": 19 ,
152+ "line": 21 ,
149153 },
150154 "message": "6",
151155 "type": "notice",
@@ -208,6 +212,7 @@ describe('API', () => {
208212 {
209213 "attachment": {
210214 "body": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
215+ "bodyEncoding": "base64",
211216 },
212217 "location": {
213218 "column": 9,
@@ -220,6 +225,7 @@ describe('API', () => {
220225 {
221226 "attachment": {
222227 "body": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
228+ "bodyEncoding": "base64",
223229 },
224230 "location": {
225231 "column": 9,
@@ -232,6 +238,7 @@ describe('API', () => {
232238 {
233239 "attachment": {
234240 "body": "",
241+ "bodyEncoding": "base64",
235242 "contentType": "text/plain",
236243 },
237244 "location": {
@@ -242,6 +249,34 @@ describe('API', () => {
242249 "message": "with contentType",
243250 "type": "notice",
244251 },
252+ {
253+ "attachment": {
254+ "body": "Hello world",
255+ "bodyEncoding": "utf-8",
256+ "contentType": "text/plain",
257+ },
258+ "location": {
259+ "column": 9,
260+ "file": "<root>/basic.test.ts",
261+ "line": 14,
262+ },
263+ "message": "bodyEncoding utf-8",
264+ "type": "notice",
265+ },
266+ {
267+ "attachment": {
268+ "body": "SGVsbG8gd29ybGQ=",
269+ "bodyEncoding": "base64",
270+ "contentType": "text/plain",
271+ },
272+ "location": {
273+ "column": 9,
274+ "file": "<root>/basic.test.ts",
275+ "line": 15,
276+ },
277+ "message": "bodyEncoding base64",
278+ "type": "notice",
279+ },
245280 ],
246281 }
247282 ` )
@@ -290,6 +325,8 @@ describe('reporters', () => {
290325 # notice: with base64 body
291326 # notice: with Uint8Array body
292327 # notice: with contentType
328+ # notice: bodyEncoding utf-8
329+ # notice: bodyEncoding base64
293330 ok 2 - suite # time=<time> {
294331 1..1
295332 ok 1 - second # time=<time>
@@ -323,6 +360,8 @@ describe('reporters', () => {
323360 # notice: with base64 body
324361 # notice: with Uint8Array body
325362 # notice: with contentType
363+ # notice: bodyEncoding utf-8
364+ # notice: bodyEncoding base64
326365 ok 2 - basic.test.ts > suite > second # time=<time>
327366 # notice: 5
328367 # notice: 6
@@ -367,6 +406,10 @@ describe('reporters', () => {
367406 </property>
368407 <property name="notice" value="with contentType">
369408 </property>
409+ <property name="notice" value="bodyEncoding utf-8">
410+ </property>
411+ <property name="notice" value="bodyEncoding base64">
412+ </property>
370413 </properties>
371414 </testcase>
372415 <testcase classname="basic.test.ts" name="suite > second" time="0">
@@ -417,9 +460,13 @@ describe('reporters', () => {
417460
418461 ::notice file=<root>/basic.test.ts,line=13,column=9::with contentType
419462
420- ::notice file=<root>/basic.test.ts,line=18,column=11::5
463+ ::notice file=<root>/basic.test.ts,line=14,column=9::bodyEncoding utf-8
464+
465+ ::notice file=<root>/basic.test.ts,line=15,column=9::bodyEncoding base64
466+
467+ ::notice file=<root>/basic.test.ts,line=20,column=11::5
421468
422- ::notice file=<root>/basic.test.ts,line=19 ,column=11::6
469+ ::notice file=<root>/basic.test.ts,line=21 ,column=11::6
423470 "
424471 ` )
425472 } )
@@ -460,12 +507,16 @@ describe('reporters', () => {
460507 ↳ with Uint8Array body
461508 ❯ basic.test.ts:13:9 notice
462509 ↳ with contentType
510+ ❯ basic.test.ts:14:9 notice
511+ ↳ bodyEncoding utf-8
512+ ❯ basic.test.ts:15:9 notice
513+ ↳ bodyEncoding base64
463514
464515 ✓ basic.test.ts > suite > second <time>
465516
466- ❯ basic.test.ts:18 :11 notice
517+ ❯ basic.test.ts:20 :11 notice
467518 ↳ 5
468- ❯ basic.test.ts:19 :11 notice
519+ ❯ basic.test.ts:21 :11 notice
469520 ↳ 6
470521
471522 "
0 commit comments