-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfixtures.js
33 lines (33 loc) · 920 Bytes
/
fixtures.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = {
notBuffers: { foo: 'bar', baz: 5, removeMe: undefined, boing: null },
valid: [
{
obj: Buffer.from('hello'),
str: '{"type":"Buffer","data":"base64:aGVsbG8="}'
},
{
obj: Buffer.from('☃ ★ ☺ ♤ ✓ ♛ ∭'),
str: '{"type":"Buffer","data":"base64:4piDIOKYhSDimLog4pmkIOKckyDimZsg4oit"}'
},
{ obj: Buffer.from(''), str: '{"type":"Buffer","data":""}' },
{
obj: Buffer.from('🌈'),
str: '{"type":"Buffer","data":"base64:8J+MiA=="}'
},
{
obj: { buf: Buffer.from('🌈'), test: 'yep' },
str: '{"buf":{"type":"Buffer","data":"base64:8J+MiA=="},"test":"yep"}'
}
],
utf8: [
{
obj: { foo: Buffer.from('🌈') },
str: '{"foo":{"type":"Buffer","data":"🌈"}}'
}
],
invalid: [
{ type: 'Buffer' },
{ type: 'Buffer', data: 500 },
{ type: 'Buffer', whatever: [123, 124, 125] }
]
}