Files
renovate/lib/modules/manager/meteor/extract.spec.ts
Sebastian Poxhofer 2fc46bdcfa test(manager): replace file snapshots with explicit assertions (#45656)
* test(manager): replace file snapshots with explicit assertions

* test(manager): replace inline snapshots with explicit assertions

* test(manager): assert on relevant sections instead of full bodies

* test(manager): drop assertions implied by full equality

* test(manager): address review feedback

* test(manager): assert depType and versioning in the regex matcher
2026-09-04 06:36:39 +00:00

52 lines
1.3 KiB
TypeScript

import { Fixtures } from '~test/fixtures.ts';
import { extractPackageFile } from './index.ts';
const input01Content = Fixtures.get('package-1.js');
describe('modules/manager/meteor/extract', () => {
describe('extractPackageFile()', () => {
it('returns empty if fails to parse', () => {
const res = extractPackageFile('blahhhhh:foo:@what\n');
expect(res).toBeNull();
});
it('returns results', () => {
const res = extractPackageFile(input01Content);
expect(res).toEqual({
deps: [
{
currentValue: '0.2.0',
datasource: 'npm',
depName: 'xml2js',
},
{
currentValue: '0.6.0',
datasource: 'npm',
depName: 'xml-crypto',
},
{
currentValue: '0.1.19',
datasource: 'npm',
depName: 'xmldom',
},
{
currentValue: '2.7.10',
datasource: 'npm',
depName: 'connect',
},
{
currentValue: '2.6.4',
datasource: 'npm',
depName: 'xmlbuilder',
},
{
currentValue: '0.2.0',
datasource: 'npm',
depName: 'querystring',
},
],
});
});
});
});