File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/snaps-controllers Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11{
2- "branches" : 92.89 ,
2+ "branches" : 92.91 ,
33 "functions" : 96.71 ,
4- "lines" : 98 ,
4+ "lines" : 98.01 ,
55 "statements" : 97.71
66}
Original file line number Diff line number Diff line change 1- import { base64ToBytes , bytesToString } from '@metamask/utils' ;
1+ import {
2+ base64ToBytes ,
3+ bytesToBase64 ,
4+ bytesToString ,
5+ stringToBytes ,
6+ } from '@metamask/utils' ;
27
38import { WebViewMessageStream } from '../services/webview/WebViewMessageStream' ;
49
@@ -52,6 +57,11 @@ export function createWebViewObjects() {
5257 name : 'a' ,
5358 target : 'b' ,
5459 getWebView : mockGetWebViewA ,
60+ // For one of the streams, we test that a custom btoa function is used.
61+ btoa : ( data : string ) => {
62+ const bytes = stringToBytes ( data ) ;
63+ return bytesToBase64 ( bytes ) ;
64+ } ,
5565 } ) ;
5666
5767 const streamB = new WebViewMessageStream ( {
You can’t perform that action at this time.
0 commit comments