0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/datasource/deb/file.spec.ts
oxdev03 c3958c9bd6
feat(datasource): add debian datasource (#30071)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Aleksandr Mezin <mezin.alexander@gmail.com>
Co-authored-by: Jasmin Müller <9011011+jazzlyn@users.noreply.github.com>
2024-08-28 17:26:56 +00:00

36 lines
1.1 KiB
TypeScript

import type { DirectoryResult } from 'tmp-promise';
import { dir } from 'tmp-promise';
import upath from 'upath';
import { Fixtures } from '../../../../test/fixtures';
import { fs } from '../../../../test/util';
import { GlobalConfig } from '../../../config/global';
import { extract } from './file';
const fixturePackagesArchivePath = Fixtures.getPath(`Packages.gz`);
describe('modules/datasource/deb/file', () => {
let cacheDir: DirectoryResult | null;
let extractedPackageFile: string;
beforeEach(async () => {
cacheDir = await dir({ unsafeCleanup: true });
GlobalConfig.set({ cacheDir: cacheDir.path });
const extractionFolder = await fs.ensureCacheDir('file');
extractedPackageFile = upath.join(extractionFolder, `package.txt`);
});
afterEach(async () => {
await cacheDir?.cleanup();
cacheDir = null;
});
describe('extract', () => {
it('should throw error for unsupported compression', async () => {
await expect(
extract(fixturePackagesArchivePath, 'xz', extractedPackageFile),
).rejects.toThrow('Unsupported compression standard');
});
});
});