File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module.exports.jest = function(config) {
1515
1616 // Configure transform ignore patterns for ES modules
1717 config . transformIgnorePatterns = [
18- '/node_modules/(?!(rehype-highlight|react-remark|unist-util-visit|unist-util-find-after|vfile|unified|bail|is-plain-obj|trough|vfile-message|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|character-entities|markdown-table|zwitch|longest-streak|escape-string-regexp|unist-util-is|hast-util-to-text|@vscode/webview-ui-toolkit|@microsoft/fast-react-wrapper|@microsoft/fast-element|@microsoft/fast-foundation|@microsoft/fast-web-utilities|exenv-es6)/)'
18+ '/node_modules/(?!(rehype-highlight|react-remark|unist-util-visit|unist-util-find-after|vfile|unified|bail|is-plain-obj|trough|vfile-message|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|character-entities|markdown-table|zwitch|longest-streak|escape-string-regexp|unist-util-is|hast-util-to-text|@vscode/webview-ui-toolkit|@microsoft/fast-react-wrapper|@microsoft/fast-element|@microsoft/fast-foundation|@microsoft/fast-web-utilities|exenv-es6|vscrui )/)'
1919 ] ;
2020
2121 return config ;
Original file line number Diff line number Diff line change 11import '@testing-library/jest-dom' ;
22
3- // Mock window.matchMedia
3+ // Mock crypto.getRandomValues
4+ Object . defineProperty ( window , 'crypto' , {
5+ value : {
6+ getRandomValues : function ( buffer : Uint8Array ) {
7+ for ( let i = 0 ; i < buffer . length ; i ++ ) {
8+ buffer [ i ] = Math . floor ( Math . random ( ) * 256 ) ;
9+ }
10+ return buffer ;
11+ }
12+ }
13+ } ) ;
14+
15+ // Mock matchMedia
416Object . defineProperty ( window , 'matchMedia' , {
517 writable : true ,
618 value : jest . fn ( ) . mockImplementation ( query => ( {
719 matches : false ,
820 media : query ,
921 onchange : null ,
10- addListener : jest . fn ( ) , // Deprecated
11- removeListener : jest . fn ( ) , // Deprecated
22+ addListener : jest . fn ( ) , // deprecated
23+ removeListener : jest . fn ( ) , // deprecated
1224 addEventListener : jest . fn ( ) ,
1325 removeEventListener : jest . fn ( ) ,
1426 dispatchEvent : jest . fn ( ) ,
You can’t perform that action at this time.
0 commit comments