renovate/lib/manager/html/extract.spec.ts
Sergei Zharinov 68ebe08858
test: Explicit snapshots for manager tests (#11329)
* test: Explicit snapshots for manager tests

* Fix snapshots

* Remove obsolete snapshots
2021-08-19 08:09:55 +02:00

31 lines
1.1 KiB
TypeScript

import { loadFixture } from '../../../test/util';
import { extractPackageFile } from '.';
const sample = loadFixture(`sample.html`);
const nothing = loadFixture(`nothing.html`);
describe('manager/html/extract', () => {
it('extractPackageFile', () => {
expect(extractPackageFile(sample)).toMatchSnapshot({
deps: [
{ depName: 'prop-types', currentValue: '15.6.1' },
{ depName: 'react', currentValue: '16.3.2' },
{ depName: 'react-dom', currentValue: '16.3.2' },
{ depName: 'react-transition-group', currentValue: '2.2.1' },
{ depName: 'popper.js', currentValue: '1.14.3' },
{ depName: 'react-popper', currentValue: '0.10.4' },
{ depName: 'reactstrap', currentValue: '7.1.0' },
{ depName: 'react-router', currentValue: '4.3.1' },
{ depName: 'react-markdown', currentValue: '4.0.6' },
{
depName: 'axios',
currentValue: '0.18.0',
currentDigest: 'sha256-mpnrJ5DpEZZkwkE1ZgkEQQJW/46CSEh/STrZKOB/qoM=',
},
],
});
});
it('returns null', () => {
expect(extractPackageFile(nothing)).toBeNull();
});
});