fix(core): update
This commit is contained in:
@ -61,12 +61,15 @@ tap.test('stringify should handle plain string', async () => {
|
||||
|
||||
tap.test('should work with buffers', async () => {
|
||||
const someObject = {
|
||||
myBuffer: Buffer.from('hello'),
|
||||
myBuffer: new TextEncoder().encode('hello')
|
||||
};
|
||||
console.log(someObject.myBuffer);
|
||||
const stringified = smartjson.stringify(someObject);
|
||||
|
||||
console.log(stringified);
|
||||
const decoded = smartjson.parse(stringified);
|
||||
expect(decoded.myBuffer.toString()).toEqual('hello');
|
||||
console.log(decoded.myBuffer);
|
||||
let text = new TextDecoder().decode(decoded.myBuffer);
|
||||
expect(text).toEqual('hello');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user