test/mocks: add cockpit os-release

Add a stub function for the `os-release` package from cockpit.
This commit is contained in:
Gianluca Zuccarelli 2025-01-23 15:11:19 +00:00 committed by Sanne Raymaekers
parent c510918f2c
commit ed8254f962
3 changed files with 15 additions and 0 deletions

View file

@ -112,6 +112,7 @@ module.exports = {
// to false // to false
cockpit: false, cockpit: false,
'cockpit/fsinfo': false, 'cockpit/fsinfo': false,
'os-release': false,
}, },
}, },
routes: { routes: {

View 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: '',
});
});
};

View file

@ -34,6 +34,7 @@ const config = {
__dirname, __dirname,
'src/test/mocks/cockpit/fsinfo' 'src/test/mocks/cockpit/fsinfo'
), ),
'os-release': path.resolve(__dirname, 'src/test/mocks/os-release'),
}, },
}, },
esbuild: { esbuild: {