From acbf829234d28f290472b51b5c6b7a2cde6b1ea4 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Tue, 9 Nov 2021 00:03:56 +0300
Subject: [PATCH] refactor: Snapshots for some random manager tests (#12560)

---
 .../extract/__snapshots__/pnpm.spec.ts.snap   |  36 ----
 lib/manager/npm/extract/pnpm.spec.ts          |  38 ++--
 .../nuget/__fixtures__/dotnet-tools.json      |  10 +
 .../__snapshots__/artifacts.spec.ts.snap      |  11 --
 .../nuget/__snapshots__/extract.spec.ts.snap  | 163 ----------------
 lib/manager/nuget/artifacts.spec.ts           |  10 +-
 lib/manager/nuget/extract.spec.ts             | 180 +++++++++++++-----
 .../__snapshots__/artifacts.spec.ts.snap      |  11 --
 lib/manager/pip-compile/artifacts.spec.ts     |   7 +-
 .../__snapshots__/extract.spec.ts.snap        |   4 +-
 lib/manager/pip_setup/extract.spec.ts         |   3 +-
 lib/manager/pip_setup/index.spec.ts           |  25 ++-
 .../__snapshots__/artifacts.spec.ts.snap      |  11 --
 lib/manager/pipenv/artifacts.spec.ts          |   5 +-
 .../poetry/__snapshots__/extract.spec.ts.snap |   7 -
 lib/manager/poetry/artifacts.spec.ts          |   3 +-
 lib/manager/poetry/extract.spec.ts            |  51 ++++-
 lib/manager/swift/index.spec.ts               |  19 +-
 18 files changed, 260 insertions(+), 334 deletions(-)
 create mode 100644 lib/manager/nuget/__fixtures__/dotnet-tools.json

diff --git a/lib/manager/npm/extract/__snapshots__/pnpm.spec.ts.snap b/lib/manager/npm/extract/__snapshots__/pnpm.spec.ts.snap
index 6c4a4b6528..2ed1382724 100644
--- a/lib/manager/npm/extract/__snapshots__/pnpm.spec.ts.snap
+++ b/lib/manager/npm/extract/__snapshots__/pnpm.spec.ts.snap
@@ -1,33 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/npm/extract/pnpm .detectPnpmWorkspaces() filters none matching packages 1`] = `
-Array [
-  Object {
-    "packageFile": "package.json",
-    "pnpmShrinkwrap": "pnpm-lock.yaml",
-  },
-  Object {
-    "packageFile": "nested-packages/group/a/package.json",
-    "packageJsonName": "@demo/nested-group-a",
-    "pnpmShrinkwrap": "pnpm-lock.yaml",
-  },
-  Object {
-    "packageFile": "not-matching/b/package.json",
-    "packageJsonName": "@not-matching/b",
-    "pnpmShrinkwrap": undefined,
-  },
-]
-`;
-
-exports[`manager/npm/extract/pnpm .detectPnpmWorkspaces() skips when pnpm shrinkwrap file has already been provided 1`] = `
-Array [
-  Object {
-    "packageFile": "package.json",
-    "pnpmShrinkwrap": "pnpm-lock.yaml",
-  },
-]
-`;
-
 exports[`manager/npm/extract/pnpm .detectPnpmWorkspaces() uses pnpm workspaces 1`] = `
 Array [
   Object {
@@ -66,11 +38,3 @@ Array [
   },
 ]
 `;
-
-exports[`manager/npm/extract/pnpm .extractPnpmFilters() detects errors in pnpm-workspace.yml file structure 1`] = `null`;
-
-exports[`manager/npm/extract/pnpm .extractPnpmFilters() detects errors when opening pnpm-workspace.yml file 1`] = `null`;
-
-exports[`manager/npm/extract/pnpm .findPnpmWorkspace() detects missing pnpm-lock.yaml when pnpm-workspace.yaml was already found 1`] = `null`;
-
-exports[`manager/npm/extract/pnpm .findPnpmWorkspace() detects missing pnpm-workspace.yaml 1`] = `null`;
diff --git a/lib/manager/npm/extract/pnpm.spec.ts b/lib/manager/npm/extract/pnpm.spec.ts
index fc69ee6aa8..99d9918198 100644
--- a/lib/manager/npm/extract/pnpm.spec.ts
+++ b/lib/manager/npm/extract/pnpm.spec.ts
@@ -24,8 +24,7 @@ describe('manager/npm/extract/pnpm', () => {
         '..'
       );
       const res = await extractPnpmFilters(workSpaceFilePath);
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toBeNull();
       expect(logger.logger.trace).toHaveBeenCalledWith(
         {
           fileName: expect.any(String),
@@ -40,8 +39,7 @@ describe('manager/npm/extract/pnpm', () => {
       });
 
       const res = await extractPnpmFilters('pnpm-workspace.yml');
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toBeNull();
       expect(logger.logger.trace).toHaveBeenCalledWith(
         expect.objectContaining({
           fileName: expect.any(String),
@@ -58,8 +56,7 @@ describe('manager/npm/extract/pnpm', () => {
 
       const packageFile = 'package.json';
       const res = await findPnpmWorkspace(packageFile);
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toBeNull();
       expect(logger.logger.trace).toHaveBeenCalledWith(
         expect.objectContaining({ packageFile }),
         'Failed to locate pnpm-workspace.yaml in a parent directory.'
@@ -71,8 +68,7 @@ describe('manager/npm/extract/pnpm', () => {
 
       const packageFile = 'package.json';
       const res = await findPnpmWorkspace(packageFile);
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toBeNull();
       expect(logger.logger.trace).toHaveBeenCalledWith(
         expect.objectContaining({
           workspaceYamlPath: 'pnpm-workspace.yaml',
@@ -138,8 +134,12 @@ describe('manager/npm/extract/pnpm', () => {
       ];
 
       await detectPnpmWorkspaces(packageFiles);
-      // FIXME: explicit assert condition
-      expect(packageFiles).toMatchSnapshot();
+      expect(packageFiles).toEqual([
+        {
+          packageFile: 'package.json',
+          pnpmShrinkwrap: 'pnpm-lock.yaml',
+        },
+      ]);
     });
 
     it('filters none matching packages', async () => {
@@ -161,8 +161,22 @@ describe('manager/npm/extract/pnpm', () => {
       ];
 
       await detectPnpmWorkspaces(packageFiles);
-      // FIXME: explicit assert condition
-      expect(packageFiles).toMatchSnapshot();
+      expect(packageFiles).toEqual([
+        {
+          packageFile: 'package.json',
+          pnpmShrinkwrap: 'pnpm-lock.yaml',
+        },
+        {
+          packageFile: 'nested-packages/group/a/package.json',
+          packageJsonName: '@demo/nested-group-a',
+          pnpmShrinkwrap: 'pnpm-lock.yaml',
+        },
+        {
+          packageFile: 'not-matching/b/package.json',
+          packageJsonName: '@not-matching/b',
+          pnpmShrinkwrap: undefined,
+        },
+      ]);
       expect(
         packageFiles.find(
           (packageFile) =>
diff --git a/lib/manager/nuget/__fixtures__/dotnet-tools.json b/lib/manager/nuget/__fixtures__/dotnet-tools.json
new file mode 100644
index 0000000000..7afd86c8f1
--- /dev/null
+++ b/lib/manager/nuget/__fixtures__/dotnet-tools.json
@@ -0,0 +1,10 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {
+    "minver-cli": {
+      "version": "2.0.0",
+      "commands": ["minver"]
+    }
+  }
+}
diff --git a/lib/manager/nuget/__snapshots__/artifacts.spec.ts.snap b/lib/manager/nuget/__snapshots__/artifacts.spec.ts.snap
index da697c5b33..380b45dbb1 100644
--- a/lib/manager/nuget/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/manager/nuget/__snapshots__/artifacts.spec.ts.snap
@@ -66,17 +66,6 @@ Array [
 ]
 `;
 
-exports[`manager/nuget/artifacts catches errors 1`] = `
-Array [
-  Object {
-    "artifactError": Object {
-      "lockFile": "packages.lock.json",
-      "stderr": "not found",
-    },
-  },
-]
-`;
-
 exports[`manager/nuget/artifacts does not update lock file when no deps changed 1`] = `Array []`;
 
 exports[`manager/nuget/artifacts does not update lock file when non-proj file is changed 1`] = `Array []`;
diff --git a/lib/manager/nuget/__snapshots__/extract.spec.ts.snap b/lib/manager/nuget/__snapshots__/extract.spec.ts.snap
index f37a61bb87..460af6dfa9 100644
--- a/lib/manager/nuget/__snapshots__/extract.spec.ts.snap
+++ b/lib/manager/nuget/__snapshots__/extract.spec.ts.snap
@@ -1,86 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/nuget/extract extractPackageFile() .config/dotnet-tools.json with-config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "2.0.0",
-      "datasource": "nuget",
-      "depName": "minver-cli",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json#protocolVersion=3",
-        "https://contoso.com/packages/",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() .config/dotnet-tools.json works 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "2.0.0",
-      "datasource": "nuget",
-      "depName": "minver-cli",
-      "depType": "nuget",
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() considers NuGet.config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json#protocolVersion=3",
-        "https://contoso.com/packages/",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() considers lower-case nuget.config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json#protocolVersion=3",
-        "https://contoso.com/packages/",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() considers pascal-case NuGet.Config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json#protocolVersion=3",
-        "https://contoso.com/packages/",
-      ],
-    },
-  ],
-}
-`;
-
 exports[`manager/nuget/extract extractPackageFile() extracts all dependencies 1`] = `
 Array [
   Object {
@@ -305,85 +224,3 @@ Array [
   },
 ]
 `;
-
-exports[`manager/nuget/extract extractPackageFile() extracts registry URLs independently 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json",
-        "https://example.org/one",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() extracts registry URLs independently 2`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://api.nuget.org/v3/index.json",
-        "https://example.org/two",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() handles NuGet.config without package sources 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() handles malformed NuGet.config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() ignores local feed in NuGet.config 1`] = `
-Object {
-  "deps": Array [
-    Object {
-      "currentValue": "4.5.0",
-      "datasource": "nuget",
-      "depName": "Autofac",
-      "depType": "nuget",
-      "registryUrls": Array [
-        "https://contoso.com/packages/",
-      ],
-    },
-  ],
-}
-`;
-
-exports[`manager/nuget/extract extractPackageFile() returns empty for invalid csproj 1`] = `
-Object {
-  "deps": Array [],
-}
-`;
diff --git a/lib/manager/nuget/artifacts.spec.ts b/lib/manager/nuget/artifacts.spec.ts
index 0a692be875..64f0890d16 100644
--- a/lib/manager/nuget/artifacts.spec.ts
+++ b/lib/manager/nuget/artifacts.spec.ts
@@ -187,7 +187,6 @@ describe('manager/nuget/artifacts', () => {
     fs.writeLocalFile.mockImplementationOnce(() => {
       throw new Error('not found');
     });
-    // FIXME: explicit assert condition
     expect(
       await nuget.updateArtifacts({
         packageFileName: 'project.csproj',
@@ -195,7 +194,14 @@ describe('manager/nuget/artifacts', () => {
         newPackageFileContent: '{}',
         config,
       })
-    ).toMatchSnapshot();
+    ).toEqual([
+      {
+        artifactError: {
+          lockFile: 'packages.lock.json',
+          stderr: 'not found',
+        },
+      },
+    ]);
   });
   it('authenticates at registries', async () => {
     const execSnapshots = mockExecAll(exec);
diff --git a/lib/manager/nuget/extract.spec.ts b/lib/manager/nuget/extract.spec.ts
index 69fa798263..587d4c61f4 100644
--- a/lib/manager/nuget/extract.spec.ts
+++ b/lib/manager/nuget/extract.spec.ts
@@ -20,10 +20,9 @@ describe('manager/nuget/extract', () => {
       setGlobalConfig();
     });
     it('returns empty for invalid csproj', async () => {
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile('nothing here', 'bogus', config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile('nothing here', 'bogus', config)).toEqual(
+        { deps: [] }
+      );
     });
     it('extracts package version dependency', async () => {
       const packageFile =
@@ -50,68 +49,140 @@ describe('manager/nuget/extract', () => {
     it('considers NuGet.config', async () => {
       const packageFile = 'with-config-file/with-config-file.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: [
+              'https://api.nuget.org/v3/index.json#protocolVersion=3',
+              'https://contoso.com/packages/',
+            ],
+          },
+        ],
+      });
     });
     it('considers lower-case nuget.config', async () => {
       const packageFile =
         'with-lower-case-config-file/with-lower-case-config-file.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: [
+              'https://api.nuget.org/v3/index.json#protocolVersion=3',
+              'https://contoso.com/packages/',
+            ],
+          },
+        ],
+      });
     });
     it('considers pascal-case NuGet.Config', async () => {
       const packageFile =
         'with-pascal-case-config-file/with-pascal-case-config-file.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: [
+              'https://api.nuget.org/v3/index.json#protocolVersion=3',
+              'https://contoso.com/packages/',
+            ],
+          },
+        ],
+      });
     });
     it('handles malformed NuGet.config', async () => {
       const packageFile =
         'with-malformed-config-file/with-malformed-config-file.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+          },
+        ],
+      });
     });
     it('handles NuGet.config without package sources', async () => {
       const packageFile =
         'without-package-sources/without-package-sources.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+          },
+        ],
+      });
     });
     it('ignores local feed in NuGet.config', async () => {
       const packageFile =
         'with-local-feed-in-config-file/with-local-feed-in-config-file.csproj';
       const contents = loadFixture(packageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: ['https://contoso.com/packages/'],
+          },
+        ],
+      });
     });
     it('extracts registry URLs independently', async () => {
       const packageFile = 'multiple-package-files/one/one.csproj';
       const contents = loadFixture(packageFile);
       const otherPackageFile = 'multiple-package-files/two/two.csproj';
       const otherContents = loadFixture(otherPackageFile);
-      // FIXME: explicit assert condition
-      expect(
-        await extractPackageFile(contents, packageFile, config)
-      ).toMatchSnapshot();
+      expect(await extractPackageFile(contents, packageFile, config)).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: [
+              'https://api.nuget.org/v3/index.json',
+              'https://example.org/one',
+            ],
+          },
+        ],
+      });
       expect(
         await extractPackageFile(otherContents, otherPackageFile, config)
-      ).toMatchSnapshot();
+      ).toEqual({
+        deps: [
+          {
+            currentValue: '4.5.0',
+            datasource: 'nuget',
+            depName: 'Autofac',
+            depType: 'nuget',
+            registryUrls: [
+              'https://api.nuget.org/v3/index.json',
+              'https://example.org/two',
+            ],
+          },
+        ],
+      });
     });
 
     it('extracts msbuild-sdks from global.json', async () => {
@@ -172,33 +243,44 @@ describe('manager/nuget/extract', () => {
 
     describe('.config/dotnet-tools.json', () => {
       const packageFile = '.config/dotnet-tools.json';
-      const contents = `{
-  "version": 1,
-  "isRoot": true,
-  "tools": {
-    "minver-cli": {
-      "version": "2.0.0",
-      "commands": ["minver"]
-    }
-  }
-}`;
+      const contents = loadFixture('dotnet-tools.json');
 
       it('works', async () => {
-        // FIXME: explicit assert condition
-        expect(
-          await extractPackageFile(contents, packageFile, config)
-        ).toMatchSnapshot();
+        expect(await extractPackageFile(contents, packageFile, config)).toEqual(
+          {
+            deps: [
+              {
+                currentValue: '2.0.0',
+                datasource: 'nuget',
+                depName: 'minver-cli',
+                depType: 'nuget',
+              },
+            ],
+          }
+        );
       });
 
       it('with-config', async () => {
-        // FIXME: explicit assert condition
         expect(
           await extractPackageFile(
             contents,
             `with-config-file/${packageFile}`,
             config
           )
-        ).toMatchSnapshot();
+        ).toEqual({
+          deps: [
+            {
+              currentValue: '2.0.0',
+              datasource: 'nuget',
+              depName: 'minver-cli',
+              depType: 'nuget',
+              registryUrls: [
+                'https://api.nuget.org/v3/index.json#protocolVersion=3',
+                'https://contoso.com/packages/',
+              ],
+            },
+          ],
+        });
       });
 
       it('wrong version', async () => {
diff --git a/lib/manager/pip-compile/__snapshots__/artifacts.spec.ts.snap b/lib/manager/pip-compile/__snapshots__/artifacts.spec.ts.snap
index 84fa937c6c..29b95f564d 100644
--- a/lib/manager/pip-compile/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/manager/pip-compile/__snapshots__/artifacts.spec.ts.snap
@@ -1,16 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/pip-compile/artifacts catches errors 1`] = `
-Array [
-  Object {
-    "artifactError": Object {
-      "lockFile": "requirements.txt",
-      "stderr": "not found",
-    },
-  },
-]
-`;
-
 exports[`manager/pip-compile/artifacts returns null if unchanged 1`] = `
 Array [
   Object {
diff --git a/lib/manager/pip-compile/artifacts.spec.ts b/lib/manager/pip-compile/artifacts.spec.ts
index 3c64357c33..4f62a4899d 100644
--- a/lib/manager/pip-compile/artifacts.spec.ts
+++ b/lib/manager/pip-compile/artifacts.spec.ts
@@ -111,7 +111,6 @@ describe('manager/pip-compile/artifacts', () => {
     fs.outputFile.mockImplementationOnce(() => {
       throw new Error('not found');
     });
-    // FIXME: explicit assert condition
     expect(
       await pipCompile.updateArtifacts({
         packageFileName: 'requirements.in',
@@ -119,7 +118,11 @@ describe('manager/pip-compile/artifacts', () => {
         newPackageFileContent: '{}',
         config,
       })
-    ).toMatchSnapshot();
+    ).toEqual([
+      {
+        artifactError: { lockFile: 'requirements.txt', stderr: 'not found' },
+      },
+    ]);
   });
 
   it('returns updated requirements.txt when doing lockfile maintenance', async () => {
diff --git a/lib/manager/pip_setup/__snapshots__/extract.spec.ts.snap b/lib/manager/pip_setup/__snapshots__/extract.spec.ts.snap
index cfeee48ee6..7c538c6aa5 100644
--- a/lib/manager/pip_setup/__snapshots__/extract.spec.ts.snap
+++ b/lib/manager/pip_setup/__snapshots__/extract.spec.ts.snap
@@ -1,8 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/pip_setup/extract getPythonAlias returns the python alias to use 1`] = `"python3.8"`;
-
-exports[`manager/pip_setup/extract getPythonAlias returns the python alias to use 2`] = `
+exports[`manager/pip_setup/extract getPythonAlias returns the python alias to use 1`] = `
 Array [
   Object {
     "cmd": "python --version",
diff --git a/lib/manager/pip_setup/extract.spec.ts b/lib/manager/pip_setup/extract.spec.ts
index 9af134d966..0fe882334b 100644
--- a/lib/manager/pip_setup/extract.spec.ts
+++ b/lib/manager/pip_setup/extract.spec.ts
@@ -35,8 +35,7 @@ describe('manager/pip_setup/extract', () => {
       ]);
       const result = await getPythonAlias();
       expect(pythonVersions).toContain(result);
-      // FIXME: explicit assert condition
-      expect(result).toMatchSnapshot();
+      expect(result).toBe('python3.8');
       expect(await getPythonAlias()).toEqual(result);
       expect(execSnapshots).toMatchSnapshot();
       expect(execSnapshots).toHaveLength(3);
diff --git a/lib/manager/pip_setup/index.spec.ts b/lib/manager/pip_setup/index.spec.ts
index de5380d6bb..10bdf73a55 100644
--- a/lib/manager/pip_setup/index.spec.ts
+++ b/lib/manager/pip_setup/index.spec.ts
@@ -67,10 +67,31 @@ describe('manager/pip_setup/index', () => {
         },
       ]);
       jest.spyOn(fs, 'readLocalFile').mockResolvedValueOnce(jsonContent);
-      // FIXME: explicit assert condition
       expect(
         await extractPackageFile(content, packageFile, config)
-      ).toMatchSnapshot();
+      ).toMatchSnapshot({
+        deps: [
+          { depName: 'celery', currentValue: '>=3.1.13.0,<5.0' },
+          { depName: 'logging_tree', currentValue: '>=1.7' },
+          { depName: 'pygments', currentValue: '>=2.2' },
+          { depName: 'psutil', currentValue: '>=5.0' },
+          { depName: 'objgraph', currentValue: '>=3.0' },
+          { depName: 'django', currentValue: '>=1.11.23,<2.0' },
+          { depName: 'flask', currentValue: '>=0.11,<2.0' },
+          { depName: 'blinker', currentValue: '>=1.4,<2.0' },
+          { depName: 'gunicorn', currentValue: '>=19.7.0,<20.0' },
+          { depName: 'statsd', currentValue: '>=3.2.1,<4.0' },
+          { depName: 'Werkzeug', currentValue: '>=0.15.3,<0.16' },
+          {
+            depName: 'requests',
+            currentValue: '>=2.10.0,<3.0',
+            skipReason: 'ignored',
+          },
+          { depName: 'raven', currentValue: '>=5.27.1,<7.0' },
+          { depName: 'future', currentValue: '>=0.15.2,<0.17' },
+          { depName: 'ipaddress', currentValue: '>=1.0.16,<2.0' },
+        ],
+      });
       expect(exec).toHaveBeenCalledTimes(3);
       expect(fixSnapshots(execSnapshots)).toMatchSnapshot();
     });
diff --git a/lib/manager/pipenv/__snapshots__/artifacts.spec.ts.snap b/lib/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
index ba04fe5ad9..d869380213 100644
--- a/lib/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
+++ b/lib/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
@@ -1,16 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/pipenv/artifacts catches errors 1`] = `
-Array [
-  Object {
-    "artifactError": Object {
-      "lockFile": "Pipfile.lock",
-      "stderr": "not found",
-    },
-  },
-]
-`;
-
 exports[`manager/pipenv/artifacts handles no constraint 1`] = `
 Array [
   Object {
diff --git a/lib/manager/pipenv/artifacts.spec.ts b/lib/manager/pipenv/artifacts.spec.ts
index c4733af3b8..fbacc6945a 100644
--- a/lib/manager/pipenv/artifacts.spec.ts
+++ b/lib/manager/pipenv/artifacts.spec.ts
@@ -131,7 +131,6 @@ describe('manager/pipenv/artifacts', () => {
     fs.outputFile.mockImplementationOnce(() => {
       throw new Error('not found');
     });
-    // FIXME: explicit assert condition
     expect(
       await pipenv.updateArtifacts({
         packageFileName: 'Pipfile',
@@ -139,7 +138,9 @@ describe('manager/pipenv/artifacts', () => {
         newPackageFileContent: '{}',
         config,
       })
-    ).toMatchSnapshot();
+    ).toEqual([
+      { artifactError: { lockFile: 'Pipfile.lock', stderr: 'not found' } },
+    ]);
   });
   it('returns updated Pipenv.lock when doing lockfile maintenance', async () => {
     fs.readFile.mockResolvedValueOnce('Current Pipfile.lock' as any);
diff --git a/lib/manager/poetry/__snapshots__/extract.spec.ts.snap b/lib/manager/poetry/__snapshots__/extract.spec.ts.snap
index 5b08fdd301..0cef52a300 100644
--- a/lib/manager/poetry/__snapshots__/extract.spec.ts.snap
+++ b/lib/manager/poetry/__snapshots__/extract.spec.ts.snap
@@ -1,12 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`manager/poetry/extract extractPackageFile() dedupes registries 1`] = `
-Array [
-  "https://pypi.org/pypi/",
-  "https://bar.baz/+simple/",
-]
-`;
-
 exports[`manager/poetry/extract extractPackageFile() extracts mixed versioning types 1`] = `
 Object {
   "constraints": Object {},
diff --git a/lib/manager/poetry/artifacts.spec.ts b/lib/manager/poetry/artifacts.spec.ts
index 357878b605..69f3922faf 100644
--- a/lib/manager/poetry/artifacts.spec.ts
+++ b/lib/manager/poetry/artifacts.spec.ts
@@ -184,7 +184,6 @@ describe('manager/poetry/artifacts', () => {
       throw new Error('not found');
     });
     const updatedDeps = [{ depName: 'dep1' }];
-    // FIXME: explicit assert condition
     expect(
       await updateArtifacts({
         packageFileName: 'pyproject.toml',
@@ -192,7 +191,7 @@ describe('manager/poetry/artifacts', () => {
         newPackageFileContent: '{}',
         config,
       })
-    ).toMatchSnapshot();
+    ).toMatchSnapshot([{ artifactError: { lockFile: 'poetry.lock' } }]);
   });
   it('returns updated poetry.lock when doing lockfile maintenance', async () => {
     fs.readFile.mockResolvedValueOnce('Old poetry.lock' as any);
diff --git a/lib/manager/poetry/extract.spec.ts b/lib/manager/poetry/extract.spec.ts
index 2b8981d29b..066f1c10e2 100644
--- a/lib/manager/poetry/extract.spec.ts
+++ b/lib/manager/poetry/extract.spec.ts
@@ -73,19 +73,58 @@ describe('manager/poetry/extract', () => {
     });
     it('dedupes registries', async () => {
       const res = await extractPackageFile(pyproject8toml, filename);
-      // FIXME: explicit assert condition
-      expect(res.registryUrls).toMatchSnapshot();
+      expect(res).toMatchObject({
+        registryUrls: ['https://pypi.org/pypi/', 'https://bar.baz/+simple/'],
+      });
     });
     it('extracts mixed versioning types', async () => {
       const res = await extractPackageFile(pyproject9toml, filename);
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toMatchSnapshot({
+        deps: [
+          { depName: 'dep1', currentValue: '0.2' },
+          { depName: 'dep2', currentValue: '1.1.0' },
+          { depName: 'dep3', currentValue: '1.0a1' },
+          { depName: 'dep4', currentValue: '1.0b2' },
+          { depName: 'dep5', currentValue: '1.0rc1' },
+          { depName: 'dep6', currentValue: '1.0.dev4' },
+          { depName: 'dep7', currentValue: '1.0c1' },
+          { depName: 'dep8', currentValue: '2012.2' },
+          { depName: 'dep9', currentValue: '1.0.dev456' },
+          { depName: 'dep10', currentValue: '1.0a1' },
+          { depName: 'dep11', currentValue: '1.0a2.dev456' },
+          { depName: 'dep12', currentValue: '1.0a12.dev456' },
+          { depName: 'dep13', currentValue: '1.0a12' },
+          { depName: 'dep14', currentValue: '1.0b1.dev456' },
+          { depName: 'dep15', currentValue: '1.0b2' },
+          { depName: 'dep16', currentValue: '1.0b2.post345.dev456' },
+          { depName: 'dep17', currentValue: '1.0b2.post345' },
+          { depName: 'dep18', currentValue: '1.0rc1.dev456' },
+          { depName: 'dep19', currentValue: '1.0rc1' },
+          { depName: 'dep20', currentValue: '1.0' },
+          { depName: 'dep21', currentValue: '1.0+abc.5' },
+          { depName: 'dep22', currentValue: '1.0+abc.7' },
+          { depName: 'dep23', currentValue: '1.0+5' },
+          { depName: 'dep24', currentValue: '1.0.post456.dev34' },
+          { depName: 'dep25', currentValue: '1.0.post456' },
+          { depName: 'dep26', currentValue: '1.1.dev1' },
+          { depName: 'dep27', currentValue: '~=3.1' },
+          { depName: 'dep28', currentValue: '~=3.1.2' },
+          { depName: 'dep29', currentValue: '~=3.1a1' },
+          { depName: 'dep30', currentValue: '==3.1' },
+          { depName: 'dep31', currentValue: '==3.1.*' },
+          { depName: 'dep32', currentValue: '~=3.1.0, !=3.1.3' },
+          { depName: 'dep33', currentValue: '<=2.0' },
+          { depName: 'dep34', currentValue: '<2.0' },
+        ],
+      });
     });
     it('resolves lockedVersions from the lockfile', async () => {
       fs.readLocalFile.mockResolvedValue(pyproject11tomlLock);
       const res = await extractPackageFile(pyproject11toml, filename);
-      // FIXME: explicit assert condition
-      expect(res).toMatchSnapshot();
+      expect(res).toMatchSnapshot({
+        constraints: { python: '^3.9' },
+        deps: [{ lockedVersion: '1.17.5' }],
+      });
     });
     it('skips git dependencies', async () => {
       const content =
diff --git a/lib/manager/swift/index.spec.ts b/lib/manager/swift/index.spec.ts
index c5dba98d7f..ca395bceb0 100644
--- a/lib/manager/swift/index.spec.ts
+++ b/lib/manager/swift/index.spec.ts
@@ -97,45 +97,38 @@ describe('manager/swift/index', () => {
       ).not.toBeNull();
     });
     it('parses package descriptions', () => {
-      // FIXME: explicit assert condition
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git",from:"1.2.3")]`
         )
-      ).toMatchSnapshot();
-      // FIXME: explicit assert condition
+      ).toMatchSnapshot({ deps: [{ currentValue: 'from:"1.2.3"' }] });
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git","1.2.3"...)]`
         )
-      ).toMatchSnapshot();
-      // FIXME: explicit assert condition
+      ).toMatchSnapshot({ deps: [{ currentValue: '"1.2.3"...' }] });
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git","1.2.3"..."1.2.4")]`
         )
-      ).toMatchSnapshot();
-      // FIXME: explicit assert condition
+      ).toMatchSnapshot({ deps: [{ currentValue: '"1.2.3"..."1.2.4"' }] });
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git","1.2.3"..<"1.2.4")]`
         )
-      ).toMatchSnapshot();
-      // FIXME: explicit assert condition
+      ).toMatchSnapshot({ deps: [{ currentValue: '"1.2.3"..<"1.2.4"' }] });
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git",..."1.2.3")]`
         )
-      ).toMatchSnapshot();
-      // FIXME: explicit assert condition
+      ).toMatchSnapshot({ deps: [{ currentValue: '..."1.2.3"' }] });
       expect(
         extractPackageFile(
           `dependencies:[.package(url:"https://github.com/vapor/vapor.git",..<"1.2.3")]`
         )
-      ).toMatchSnapshot();
+      ).toMatchSnapshot({ deps: [{ currentValue: '..<"1.2.3"' }] });
     });
     it('parses multiple packages', () => {
-      // FIXME: explicit assert condition
       expect(extractPackageFile(pkgContent)).toMatchSnapshot();
     });
   });
-- 
GitLab