test/mocks: add cockpit os-release
Add a stub function for the `os-release` package from cockpit.
This commit is contained in:
parent
c510918f2c
commit
ed8254f962
3 changed files with 15 additions and 0 deletions
|
|
@ -112,6 +112,7 @@ module.exports = {
|
|||
// to false
|
||||
cockpit: false,
|
||||
'cockpit/fsinfo': false,
|
||||
'os-release': false,
|
||||
},
|
||||
},
|
||||
routes: {
|
||||
|
|
|
|||
13
src/test/mocks/os-release/index.ts
Normal file
13
src/test/mocks/os-release/index.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type osRelease = {
|
||||
ID: string;
|
||||
VERSION_ID: string;
|
||||
};
|
||||
|
||||
export const read_os_release = (): Promise<osRelease> => {
|
||||
return new Promise((resolve) => {
|
||||
resolve({
|
||||
ID: '',
|
||||
VERSION_ID: '',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -34,6 +34,7 @@ const config = {
|
|||
__dirname,
|
||||
'src/test/mocks/cockpit/fsinfo'
|
||||
),
|
||||
'os-release': path.resolve(__dirname, 'src/test/mocks/os-release'),
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue