File tree Expand file tree Collapse file tree 3 files changed +33
-5
lines changed
Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ module.exports = {
3131 config . plugins = [
3232 ...config . plugins ,
3333 new webpack . NormalModuleReplacementPlugin (
34- / w e b e x t e n s i o n - p o l y f i l l - t s / ,
34+ / w e b e x t e n s i o n - p o l y f i l l / ,
3535 ( resource ) => {
3636 // Gets absolute path to mock `webextension-polyfill-ts` package
3737 // NOTE: this is required beacuse the `webextension-polyfill-ts`
3838 // package can't be used outside the environment provided by web extensions
3939 const absRootMockPath = path . resolve (
4040 __dirname ,
41- "../src/__mocks__/webextension-polyfill-ts .ts" ,
41+ "../src/__mocks__/webextension-polyfill.ts" ,
4242 ) ;
4343
4444 // Gets relative path from requesting module to our mocked module
Original file line number Diff line number Diff line change 1- // src/__mocks__/webextension-polyfill-ts
2- // Update this file to include any mocks for the `webextension-polyfill-ts ` package
1+ // src/__mocks__/webextension-polyfill
2+ // Update this file to include any mocks for the `webextension-polyfill` package
33// This is used to mock these values for Storybook so you can develop your components
44// outside the Web Extension environment provided by a compatible browser
5- // See .storybook/main.js to see how this module is swapped in for `webextension-polyfill-ts `
5+ // See .storybook/main.js to see how this module is swapped in for `webextension-polyfill`
66export const browser : any = {
77 tabs : {
88 executeScript ( currentTabId : number , details : any ) {
Original file line number Diff line number Diff line change 1+ // src/__mocks__/webextension-polyfill-ts
2+ // Update this file to include any mocks for the `webextension-polyfill-ts` package
3+ // This is used to mock these values for Storybook so you can develop your components
4+ // outside the Web Extension environment provided by a compatible browser
5+ // See .storybook/main.js to see how this module is swapped in for `webextension-polyfill-ts`
6+ export const browser : any = {
7+ tabs : {
8+ executeScript ( currentTabId : number , details : any ) {
9+ return Promise . resolve ( { done : true } ) ;
10+ } ,
11+ query ( params : any ) : Promise < Tab [ ] > {
12+ return Promise . resolve ( [ ] ) ;
13+ } ,
14+ } ,
15+ runtime : {
16+ sendMessage : ( params : { popupMounted : boolean } ) => {
17+ return ;
18+ } ,
19+ } ,
20+ } ;
21+
22+ interface Tab {
23+ id : number ;
24+ }
25+
26+ export interface Tabs {
27+ Tab : Tab ;
28+ }
You can’t perform that action at this time.
0 commit comments