@@ -16,6 +16,7 @@ import type * as webpack from '../../webpack';
1616import type * as utils from '../../webpack/utils' ;
1717import { BROWSERSLIST_FILE } from '../../webpack/utils' ;
1818import { build } from './implementation' ;
19+ import { SemVerVersion } from '@metamask/utils' ;
1920
2021const { promises : fs } = normalFs ;
2122
@@ -36,7 +37,10 @@ jest.mock('../../webpack', () => ({
3637 . requireActual < typeof webpack > ( '../../webpack' )
3738 . getCompiler ( ...args ) ;
3839
40+ // @ts -expect-error: Type mismatch.
3941 compiler . inputFileSystem = normalFs ;
42+
43+ // @ts -expect-error: Type mismatch.
4044 compiler . outputFileSystem = normalFs ;
4145
4246 return compiler ;
@@ -48,6 +52,7 @@ jest.mock('../../webpack/utils', () => ({
4852 getDefaultLoader : jest . fn <
4953 ReturnType < typeof utils . getDefaultLoader > ,
5054 Parameters < typeof utils . getDefaultLoader >
55+ // @ts -expect-error: Type mismatch.
5156 > ( async ( config ) => {
5257 if ( config . legacy ) {
5358 return {
@@ -66,7 +71,7 @@ describe('build', () => {
6671 beforeEach ( async ( ) => {
6772 const { manifest } = await getMockSnapFilesWithUpdatedChecksum ( {
6873 manifest : getSnapManifest ( {
69- platformVersion : getPlatformVersion ( ) ,
74+ platformVersion : getPlatformVersion ( ) as SemVerVersion ,
7075 } ) ,
7176 } ) ;
7277
@@ -129,7 +134,7 @@ describe('build', () => {
129134
130135 const output = await fs . readFile ( '/snap/output.js' , 'utf8' ) ;
131136 expect ( output ) . toMatchInlineSnapshot (
132- `"(()=>{var r={67 :r=>{r.exports.onRpcRequest=({request:r})=>{console.log("Hello, world!");const{method:e,id:o}=r;return e+o}}},e={};var o=function o(t){var s=e[t];if(void 0!==s)return s.exports;var n=e[t]={exports:{}};return r[t](n,n.exports,o),n.exports}(67 );module.exports=o})();"` ,
137+ `"(()=>{var r={157 :r=>{r.exports.onRpcRequest=({request:r})=>{console.log("Hello, world!");const{method:e,id:o}=r;return e+o}}},e={};var o=function o(t){var s=e[t];if(void 0!==s)return s.exports;var n=e[t]={exports:{}};return r[t](n,n.exports,o),n.exports}(157 );module.exports=o})();"` ,
133138 ) ;
134139 } ) ;
135140
@@ -165,7 +170,7 @@ describe('build', () => {
165170 expect ( output ) . toMatchInlineSnapshot ( `
166171 "(() => {
167172 var __webpack_modules__ = {
168- 67 : module => {
173+ 157 : module => {
169174 module.exports.onRpcRequest = ({
170175 request
171176 }) => {
@@ -190,7 +195,7 @@ describe('build', () => {
190195 __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
191196 return module.exports;
192197 }
193- var __webpack_exports__ = __webpack_require__(67 );
198+ var __webpack_exports__ = __webpack_require__(157 );
194199 module.exports = __webpack_exports__;
195200 })();"
196201 ` ) ;
0 commit comments