mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 17:16:25 +00:00
b255275632
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
22 lines
814 B
TypeScript
22 lines
814 B
TypeScript
import { getName, loadFixture } from '../../../test/util';
|
|
import { extractPackageFile } from '.';
|
|
|
|
const brokenYaml = loadFixture(__filename, 'update.yaml');
|
|
const packageFile = loadFixture(__filename, 'extract.yaml');
|
|
|
|
describe(getName(__filename), () => {
|
|
describe('extractPackageFile', () => {
|
|
it('should return null if package does not contain any deps', () => {
|
|
const res = extractPackageFile('foo: bar', 'pubspec.yaml');
|
|
expect(res).toBeNull();
|
|
});
|
|
it('should return null if package is invalid', () => {
|
|
const res = extractPackageFile(brokenYaml, 'pubspec.yaml');
|
|
expect(res).toBeNull();
|
|
});
|
|
it('should return valid dependencies', () => {
|
|
const res = extractPackageFile(packageFile, 'pubspec.yaml');
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|