From a253e9d638b126f3050f05e50d3aa02e694183f3 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sun, 2 Feb 2020 08:59:58 +0100 Subject: [PATCH] test: remove noisy snapshots Ref #5277 --- .../__snapshots__/validation.spec.ts.snap | 11 -- test/config/validation.spec.ts | 2 +- .../extract/__snapshots__/index.spec.ts.snap | 125 ------------------ test/workers/repository/extract/index.spec.ts | 2 +- 4 files changed, 2 insertions(+), 138 deletions(-) diff --git a/test/config/__snapshots__/validation.spec.ts.snap b/test/config/__snapshots__/validation.spec.ts.snap index b8f36dbfb9..05e4eb1e59 100644 --- a/test/config/__snapshots__/validation.spec.ts.snap +++ b/test/config/__snapshots__/validation.spec.ts.snap @@ -90,17 +90,6 @@ Array [ ] `; -exports[`config/validation validateConfig(config) included unsupported manager 1`] = ` -Array [ - Object { - "depName": "Configuration Error", - "message": "packageRules: - You have included an unsupported manager in a package rule. Your list: foo. - Supported managers are: (ansible, bazel, buildkite, bundler, cargo, cdnurl, circleci, composer, deps-edn, docker-compose, dockerfile, droneci, git-submodules, github-actions, gitlabci, gitlabci-include, gomod, gradle, gradle-wrapper, helm-requirements, helmfile, homebrew, kubernetes, leiningen, maven, meteor, mix, npm, nuget, nvm, pip_requirements, pip_setup, pipenv, poetry, pub, sbt, swift, terraform, travis, ruby-version).", - }, -] -`; - exports[`config/validation validateConfig(config) returns deprecation warnings 1`] = ` Array [ Object { diff --git a/test/config/validation.spec.ts b/test/config/validation.spec.ts index d9aae76246..fca675808c 100644 --- a/test/config/validation.spec.ts +++ b/test/config/validation.spec.ts @@ -55,7 +55,7 @@ describe('config/validation', () => { ); expect(warnings).toHaveLength(0); expect(errors).toHaveLength(1); - expect(errors).toMatchSnapshot(); + expect(errors[0].message.includes('ansible')).toBe(true); }); it('included managers of the wrong type', async () => { const config = { diff --git a/test/workers/repository/extract/__snapshots__/index.spec.ts.snap b/test/workers/repository/extract/__snapshots__/index.spec.ts.snap index d63407073d..c3293e31cf 100644 --- a/test/workers/repository/extract/__snapshots__/index.spec.ts.snap +++ b/test/workers/repository/extract/__snapshots__/index.spec.ts.snap @@ -1,130 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository/extract/index extractAllDependencies() runs 1`] = ` -Object { - "ansible": Array [ - Object {}, - ], - "bazel": Array [ - Object {}, - ], - "buildkite": Array [ - Object {}, - ], - "bundler": Array [ - Object {}, - ], - "cargo": Array [ - Object {}, - ], - "cdnurl": Array [ - Object {}, - ], - "circleci": Array [ - Object {}, - ], - "composer": Array [ - Object {}, - ], - "deps-edn": Array [ - Object {}, - ], - "docker-compose": Array [ - Object {}, - ], - "dockerfile": Array [ - Object {}, - ], - "droneci": Array [ - Object {}, - ], - "git-submodules": Array [ - Object {}, - ], - "github-actions": Array [ - Object {}, - ], - "gitlabci": Array [ - Object {}, - ], - "gitlabci-include": Array [ - Object {}, - ], - "gomod": Array [ - Object {}, - ], - "gradle": Array [ - Object {}, - ], - "gradle-wrapper": Array [ - Object {}, - ], - "helm-requirements": Array [ - Object {}, - ], - "helmfile": Array [ - Object {}, - ], - "homebrew": Array [ - Object {}, - ], - "kubernetes": Array [ - Object {}, - ], - "leiningen": Array [ - Object {}, - ], - "maven": Array [ - Object {}, - ], - "meteor": Array [ - Object {}, - ], - "mix": Array [ - Object {}, - ], - "npm": Array [ - Object {}, - ], - "nuget": Array [ - Object {}, - ], - "nvm": Array [ - Object {}, - ], - "pip_requirements": Array [ - Object {}, - ], - "pip_setup": Array [ - Object {}, - ], - "pipenv": Array [ - Object {}, - ], - "poetry": Array [ - Object {}, - ], - "pub": Array [ - Object {}, - ], - "ruby-version": Array [ - Object {}, - ], - "sbt": Array [ - Object {}, - ], - "swift": Array [ - Object {}, - ], - "terraform": Array [ - Object {}, - ], - "travis": Array [ - Object {}, - ], -} -`; - exports[`workers/repository/extract/index extractAllDependencies() skips non-enabled maangers 1`] = ` Object { "npm": Array [ diff --git a/test/workers/repository/extract/index.spec.ts b/test/workers/repository/extract/index.spec.ts index 66082da9e7..cc53889a2f 100644 --- a/test/workers/repository/extract/index.spec.ts +++ b/test/workers/repository/extract/index.spec.ts @@ -17,7 +17,7 @@ describe('workers/repository/extract/index', () => { it('runs', async () => { managerFiles.getManagerPackageFiles.mockResolvedValue([{} as never]); const res = await extractAllDependencies(config); - expect(res).toMatchSnapshot(); + expect(Object.keys(res).includes('ansible')).toBe(true); }); it('skips non-enabled maangers', async () => { config.enabledManagers = ['npm']; -- GitLab