diff --git a/lib/manager/cake/index.spec.ts b/lib/manager/cake/index.spec.ts index 1b143e69e8ce3851d1e6df44afb302aee340eb7e..059e98cc5b5110636bebb8a2db210b9146d2f73c 100644 --- a/lib/manager/cake/index.spec.ts +++ b/lib/manager/cake/index.spec.ts @@ -5,7 +5,15 @@ const content = loadFixture('build.cake'); describe(getName(), () => { it('extracts', () => { - // FIXME: explicit assert condition - expect(extractPackageFile(content)).toMatchSnapshot(); + expect(extractPackageFile(content)).toMatchSnapshot({ + deps: [ + { depName: 'Foo.Foo', currentValue: '1.1.1' }, + { depName: 'Bim.Bim', currentValue: '6.6.6' }, + { depName: 'Bar.Bar', registryUrls: ['https://example.com'] }, + { depName: 'Baz.Baz', skipReason: 'unsupported-url' }, + { depName: 'Cake.7zip', currentValue: '1.0.3' }, + { depName: 'Cake.asciidoctorj', currentValue: '1.0.0' }, + ], + }); }); }); diff --git a/lib/manager/cargo/__snapshots__/artifacts.spec.ts.snap b/lib/manager/cargo/__snapshots__/artifacts.spec.ts.snap index a5b226ee83ee1b3e2bbfbbb41f596a6534839d25..c4379f28540af2427536351acfa90fd97aae4513 100644 --- a/lib/manager/cargo/__snapshots__/artifacts.spec.ts.snap +++ b/lib/manager/cargo/__snapshots__/artifacts.spec.ts.snap @@ -1,16 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`.updateArtifacts() catches errors 1`] = ` -Array [ - Object { - "artifactError": Object { - "lockFile": "Cargo.lock", - "stderr": "not found", - }, - }, -] -`; - exports[`.updateArtifacts() returns null if unchanged 1`] = ` Array [ Object { diff --git a/lib/manager/cargo/artifacts.spec.ts b/lib/manager/cargo/artifacts.spec.ts index e31e3e007bc7feb459262f7914d467ddc2da1d2e..69add232ba8ccd0a5eb74d395baca6e327afa75c 100644 --- a/lib/manager/cargo/artifacts.spec.ts +++ b/lib/manager/cargo/artifacts.spec.ts @@ -201,7 +201,6 @@ describe('.updateArtifacts()', () => { depName: 'dep1', }, ]; - // FIXME: explicit assert condition expect( await cargo.updateArtifacts({ packageFileName: 'Cargo.toml', @@ -209,6 +208,8 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '{}', config, }) - ).toMatchSnapshot(); + ).toEqual([ + { artifactError: { lockFile: 'Cargo.lock', stderr: 'not found' } }, + ]); }); }); diff --git a/lib/manager/cdnurl/extract.spec.ts b/lib/manager/cdnurl/extract.spec.ts index 38cd63148d00c773cda26c62b2d7c045d5686f4e..d6006986e2351b5840ce5b1d594bd72ad4d02c39 100644 --- a/lib/manager/cdnurl/extract.spec.ts +++ b/lib/manager/cdnurl/extract.spec.ts @@ -5,7 +5,23 @@ const input = loadFixture(`sample.txt`); describe(getName(), () => { it('extractPackageFile', () => { - // FIXME: explicit assert condition - expect(extractPackageFile(input)).toMatchSnapshot(); + expect(extractPackageFile(input)).toMatchSnapshot({ + deps: [ + { + depName: 'prop-types', + currentValue: '15.6.1', + lookupName: 'prop-types/prop-types.min.js', + }, + { 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' }, + ], + }); }); }); diff --git a/lib/manager/circleci/extract.spec.ts b/lib/manager/circleci/extract.spec.ts index cfbdccb7397c314bb22a24a016fa2a18cc4275f5..a165c43ab7caf7434fd629e4a657bb20776f0988 100644 --- a/lib/manager/circleci/extract.spec.ts +++ b/lib/manager/circleci/extract.spec.ts @@ -17,14 +17,38 @@ describe(getName(), () => { }); it('extracts orbs too', () => { const res = extractPackageFile(file2); - // FIXME: explicit assert condition - expect(res.deps).toMatchSnapshot(); - // expect(res.deps).toHaveLength(4); + expect(res.deps).toMatchSnapshot([ + { + depName: 'release-workflows', + currentValue: '4.1.0', + datasource: 'orb', + depType: 'orb', + }, + { + depName: 'no-version', + currentValue: undefined, + datasource: 'orb', + depType: 'orb', + }, + { + depName: 'volatile', + currentValue: 'volatile', + datasource: 'orb', + depType: 'orb', + }, + {}, + {}, + {}, + {}, + {}, + {}, + ]); }); it('extracts image without leading dash', () => { const res = extractPackageFile(file3); - // FIXME: explicit assert condition - expect(res.deps).toMatchSnapshot(); + expect(res.deps).toMatchSnapshot([ + { currentValue: '14.8.0', depName: 'cimg/node' }, + ]); }); }); }); diff --git a/lib/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap b/lib/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap index af1a2350d6120b19f3e2fb940704a7ca0141d624..ef0777414e78430489bd97f0d010b3e5741eed88 100644 --- a/lib/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap +++ b/lib/manager/cocoapods/__snapshots__/artifacts.spec.ts.snap @@ -1,18 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`.updateArtifacts() catches write error 1`] = ` -Array [ - Object { - "artifactError": Object { - "lockFile": "Podfile.lock", - "stderr": "not found", - }, - }, -] -`; - -exports[`.updateArtifacts() catches write error 2`] = `Array []`; - exports[`.updateArtifacts() dynamically selects Docker image tag 1`] = ` Array [ Object { @@ -118,17 +105,6 @@ Array [ exports[`.updateArtifacts() returns null if updatedDeps is empty 1`] = `Array []`; exports[`.updateArtifacts() returns pod exec error 1`] = ` -Array [ - Object { - "artifactError": Object { - "lockFile": "Podfile.lock", - "stderr": "exec exception", - }, - }, -] -`; - -exports[`.updateArtifacts() returns pod exec error 2`] = ` Array [ Object { "cmd": "pod install", diff --git a/lib/manager/cocoapods/artifacts.spec.ts b/lib/manager/cocoapods/artifacts.spec.ts index 4cf383f3f3566636417c6dc6703dd6130d1dc578..91f429b107013b1910a2752509a7534fa09df697 100644 --- a/lib/manager/cocoapods/artifacts.spec.ts +++ b/lib/manager/cocoapods/artifacts.spec.ts @@ -130,7 +130,6 @@ describe('.updateArtifacts()', () => { modified: ['Podfile.lock'], } as StatusResult); fs.readFile.mockResolvedValueOnce('New Podfile' as any); - // FIXME: explicit assert condition expect( await updateArtifacts({ packageFileName: 'Podfile', @@ -138,7 +137,7 @@ describe('.updateArtifacts()', () => { newPackageFileContent: 'plugin "cocoapods-acknowledgements"', config, }) - ).toMatchSnapshot(); + ).toMatchSnapshot([{ file: { contents: 'New Podfile' } }]); expect(execSnapshots).toMatchSnapshot(); }); it('returns updated Podfile and Pods files', async () => { @@ -152,7 +151,6 @@ describe('.updateArtifacts()', () => { modified: ['Podfile.lock', 'Pods/Manifest.lock'], deleted: ['Pods/Deleted'], } as StatusResult); - // FIXME: explicit assert condition expect( await updateArtifacts({ packageFileName: 'Podfile', @@ -160,7 +158,12 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '', config, }) - ).toMatchSnapshot(); + ).toMatchSnapshot([ + { file: { name: 'Podfile.lock' } }, + { file: { name: 'Pods/Manifest.lock' } }, + { file: { name: 'Pods/New' } }, + { file: { name: '|delete|' } }, + ]); expect(execSnapshots).toMatchSnapshot(); }); it('catches write error', async () => { @@ -169,7 +172,6 @@ describe('.updateArtifacts()', () => { fs.outputFile.mockImplementationOnce(() => { throw new Error('not found'); }); - // FIXME: explicit assert condition expect( await updateArtifacts({ packageFileName: 'Podfile', @@ -177,15 +179,16 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '', config, }) - ).toMatchSnapshot(); - expect(execSnapshots).toMatchSnapshot(); + ).toEqual([ + { artifactError: { lockFile: 'Podfile.lock', stderr: 'not found' } }, + ]); + expect(execSnapshots).toBeEmpty(); }); it('returns pod exec error', async () => { const execSnapshots = mockExecAll(exec, new Error('exec exception')); fs.readFile.mockResolvedValueOnce('Old Podfile.lock' as any); fs.outputFile.mockResolvedValueOnce(null as never); fs.readFile.mockResolvedValueOnce('Old Podfile.lock' as any); - // FIXME: explicit assert condition expect( await updateArtifacts({ packageFileName: 'Podfile', @@ -193,7 +196,9 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '', config, }) - ).toMatchSnapshot(); + ).toEqual([ + { artifactError: { lockFile: 'Podfile.lock', stderr: 'exec exception' } }, + ]); expect(execSnapshots).toMatchSnapshot(); }); it('dynamically selects Docker image tag', async () => { @@ -215,8 +220,11 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '', config, }); - // FIXME: explicit assert condition - expect(execSnapshots).toMatchSnapshot(); + expect(execSnapshots).toMatchSnapshot([ + { cmd: 'docker pull renovate/cocoapods:1.2.4' }, + {}, + {}, + ]); }); it('falls back to the `latest` Docker image tag', async () => { const execSnapshots = mockExecAll(exec); @@ -240,7 +248,10 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '', config, }); - // FIXME: explicit assert condition - expect(execSnapshots).toMatchSnapshot(); + expect(execSnapshots).toMatchSnapshot([ + { cmd: 'docker pull renovate/cocoapods:latest' }, + {}, + {}, + ]); }); });