diff --git a/lib/util/__snapshots__/host-rules.spec.ts.snap b/lib/util/__snapshots__/host-rules.spec.ts.snap deleted file mode 100644 index f4d1483d248fee..00000000000000 --- a/lib/util/__snapshots__/host-rules.spec.ts.snap +++ /dev/null @@ -1,47 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/host-rules add() supports baseUrl-only 1`] = ` -Object { - "password": "pass1", - "username": "user1", -} -`; - -exports[`util/host-rules find() matches on endpoint subresource 1`] = ` -Object { - "token": "abc", -} -`; - -exports[`util/host-rules find() matches on hostName 1`] = ` -Object { - "token": "abc", -} -`; - -exports[`util/host-rules find() matches on hostType 1`] = ` -Object { - "token": "abc", -} -`; - -exports[`util/host-rules find() needs exact host matches 1`] = `Object {}`; - -exports[`util/host-rules find() returns hosts 1`] = ` -Array [ - "nuget.local", - "my.local.registry", - "another.local.registry", - "yet.another.local.registry", -] -`; - -exports[`util/host-rules findAll() needs exact host matches 1`] = ` -Object { - "hostType": "nuget", - "matchHost": "nuget.org", - "password": "p4$$w0rd", - "resolvedHost": "nuget.org", - "username": "root", -} -`; diff --git a/lib/util/__snapshots__/markdown.spec.ts.snap b/lib/util/__snapshots__/markdown.spec.ts.snap deleted file mode 100644 index 6921d99da119f1..00000000000000 --- a/lib/util/__snapshots__/markdown.spec.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/markdown .linkify works 1`] = ` -"Some references: - -- Commit: [\`f808317\`](https://github.com/some/repo/commit/f8083175fe890cbf14f41d0a06e7aa35d4989587) -- Commit (fork): [foo@\`f808317\`](https://github.com/foo/repo/commit/f8083175fe890cbf14f41d0a06e7aa35d4989587) -- Commit (repo): [remarkjs/remark@\`e1aa9f6\`](https://github.com/remarkjs/remark/commit/e1aa9f6c02de18b9459b7d269712bcb50183ce89) -- Issue or PR (\`#\`): [#1](https://github.com/some/repo/issues/1) -- Issue or PR (\`GH-\`): [GH-1](https://github.com/some/repo/issues/1) -- Issue or PR (fork): [foo#1](https://github.com/foo/repo/issues/1) -- Issue or PR (project): [remarkjs/remark#1](https://github.com/remarkjs/remark/issues/1) -- Mention: [@wooorm](https://github.com/wooorm) -" -`; diff --git a/lib/util/__snapshots__/package-rules.spec.ts.snap b/lib/util/__snapshots__/package-rules.spec.ts.snap deleted file mode 100644 index 3220cf2227bdc2..00000000000000 --- a/lib/util/__snapshots__/package-rules.spec.ts.snap +++ /dev/null @@ -1,57 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/package-rules applies 1`] = ` -Object { - "currentValue": "1.0.0", - "depName": "a", - "isBump": true, - "matchUpdateTypes": Array [ - "bump", - ], - "packageRules": Array [ - Object { - "matchCurrentVersion": "<= 2.0.0", - "matchPackagePatterns": Array [ - "*", - ], - }, - Object { - "matchCurrentVersion": "<= 2.0.0", - "matchPackageNames": Array [ - "b", - ], - }, - Object { - "excludePackagePatterns": Array [ - "*", - ], - "matchPackageNames": Array [ - "b", - ], - }, - Object { - "matchUpdateTypes": Array [ - "bump", - ], - }, - Object { - "excludePackageNames": Array [ - "a", - ], - "matchPackageNames": Array [ - "b", - ], - }, - Object { - "matchCurrentVersion": "<= 2.0.0", - }, - ], -} -`; - -exports[`util/package-rules empty rules 1`] = ` -Object { - "foo": "bar", - "packageRules": null, -} -`; diff --git a/lib/util/exec/__snapshots__/index.spec.ts.snap b/lib/util/exec/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 6a7afe72fbbcef..00000000000000 --- a/lib/util/exec/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/exec/index Supports image prefetch 1`] = ` -Array [ - "echo hello", - "echo hello", - "docker pull renovate/image", - "docker ps --filter name=renovate_image -aq", - "docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c \\"echo hello\\"", - "docker ps --filter name=renovate_image -aq", - "docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c \\"echo hello\\"", - "echo hello", - "echo hello", - "docker ps --filter name=renovate_image -aq", - "docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c \\"echo hello\\"", - "docker ps --filter name=renovate_image -aq", - "docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c \\"echo hello\\"", -] -`; diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts index 128da9a20110ca..d7a2cb02ddcd68 100644 --- a/lib/util/exec/index.spec.ts +++ b/lib/util/exec/index.spec.ts @@ -748,8 +748,21 @@ describe('util/exec/index', () => { await exec(inCmd, { docker }); await exec(inCmd, { docker }); - // FIXME: explicit assert condition - expect(actualCmd).toMatchSnapshot(); + expect(actualCmd).toEqual([ + `echo hello`, + `echo hello`, + `docker pull renovate/image`, + `docker ps --filter name=renovate_image -aq`, + `docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c "echo hello"`, + `docker ps --filter name=renovate_image -aq`, + `docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c "echo hello"`, + `echo hello`, + `echo hello`, + `docker ps --filter name=renovate_image -aq`, + `docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c "echo hello"`, + `docker ps --filter name=renovate_image -aq`, + `docker run --rm --name=renovate_image --label=renovate_child renovate/image bash -l -c "echo hello"`, + ]); }); it('Supports binarySource=install', async () => { process.env = processEnv; diff --git a/lib/util/git/__snapshots__/index.spec.ts.snap b/lib/util/git/__snapshots__/index.spec.ts.snap deleted file mode 100644 index b3b416d2b00078..00000000000000 --- a/lib/util/git/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,46 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/git/index getBranchFiles(branchName) detects changed files compared to current base branch 1`] = ` -Array [ - "some-new-file", -] -`; - -exports[`util/git/index getCommitMessages() returns commit messages 1`] = ` -Array [ - "master message", - "past message", -] -`; - -exports[`util/git/index getFileList() should exclude submodules 1`] = ` -Array [ - ".gitmodules", - "file_to_delete", - "master_file", - "past_file", -] -`; - -exports[`util/git/index getFileList() should return the correct files 1`] = ` -Array [ - "file_to_delete", - "master_file", - "past_file", -] -`; - -exports[`util/git/index initRepo()) should fetch latest 1`] = ` -Array [ - "master message", - "past message", -] -`; - -exports[`util/git/index initRepo()) should fetch latest 2`] = ` -Array [ - "past message2", - "master message", - "past message", -] -`; diff --git a/lib/util/git/author.spec.ts b/lib/util/git/author.spec.ts index 6e16f627c4bb25..26f737e02cb7be 100644 --- a/lib/util/git/author.spec.ts +++ b/lib/util/git/author.spec.ts @@ -9,31 +9,23 @@ describe('util/git/author', () => { expect(parseGitAuthor('renovate@whitesourcesoftware.com')).not.toBeNull(); }); it('parses bot email', () => { - // FIXME: explicit assert condition - expect(parseGitAuthor('renovate[bot]@users.noreply.github.com')) - .toMatchInlineSnapshot(` - Object { - "address": "renovate[bot]@users.noreply.github.com", - "name": "renovate[bot]", - } - `); + expect(parseGitAuthor('renovate[bot]@users.noreply.github.com')).toEqual({ + address: 'renovate[bot]@users.noreply.github.com', + name: 'renovate[bot]', + }); }); it('parses bot name and email', () => { - // FIXME: explicit assert condition expect( parseGitAuthor('renovate[bot] ') - ).toMatchInlineSnapshot(` - Object { - "address": "renovate[bot]@users.noreply.github.com", - "name": "renovate[bot]", - } - `); + ).toEqual({ + address: 'renovate[bot]@users.noreply.github.com', + name: 'renovate[bot]', + }); }); it('escapes names', () => { - // FIXME: explicit assert condition - expect( - parseGitAuthor('name [what] ').name - ).toMatchInlineSnapshot(`"name [what]"`); + expect(parseGitAuthor('name [what] ').name).toEqual( + `name [what]` + ); }); it('tries again and fails', () => { expect(parseGitAuthor('foo')).toBeNull(); diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index 38afe5b30ff43a..259148798dae8a 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -111,8 +111,11 @@ describe('util/git/index', () => { }); describe('getFileList()', () => { it('should return the correct files', async () => { - // FIXME: explicit assert condition - expect(await git.getFileList()).toMatchSnapshot(); + expect(await git.getFileList()).toEqual([ + 'file_to_delete', + 'master_file', + 'past_file', + ]); }); it('should exclude submodules', async () => { const repo = Git(base.path); @@ -124,8 +127,12 @@ describe('util/git/index', () => { }); await git.syncGit(); expect(await fs.pathExists(tmpDir.path + '/.gitmodules')).toBeTruthy(); - // FIXME: explicit assert condition - expect(await git.getFileList()).toMatchSnapshot(); + expect(await git.getFileList()).toEqual([ + '.gitmodules', + 'file_to_delete', + 'master_file', + 'past_file', + ]); await repo.reset(['--hard', 'HEAD^']); }); }); @@ -210,8 +217,7 @@ describe('util/git/index', () => { const branchFiles = await git.getBranchFiles( 'renovate/branch_with_changes' ); - // FIXME: explicit assert condition - expect(branchFiles).toMatchSnapshot(); + expect(branchFiles).toEqual(['some-new-file']); }); }); @@ -441,8 +447,10 @@ describe('util/git/index', () => { describe('getCommitMessages()', () => { it('returns commit messages', async () => { - // FIXME: explicit assert condition - expect(await git.getCommitMessages()).toMatchSnapshot(); + expect(await git.getCommitMessages()).toEqual([ + 'master message', + 'past message', + ]); }); }); @@ -489,8 +497,10 @@ describe('util/git/index', () => { expect(git.branchExists('test')).toBeFalsy(); - // FIXME: explicit assert condition - expect(await git.getCommitMessages()).toMatchSnapshot(); + expect(await git.getCommitMessages()).toEqual([ + 'master message', + 'past message', + ]); await git.checkoutBranch('develop'); @@ -503,7 +513,7 @@ describe('util/git/index', () => { await git.checkoutBranch('test'); const msg = await git.getCommitMessages(); - expect(msg).toMatchSnapshot(); + expect(msg).toEqual(['past message2', 'master message', 'past message']); expect(msg).toContain('past message2'); }); diff --git a/lib/util/host-rules.spec.ts b/lib/util/host-rules.spec.ts index 9f64b19c6311ae..4ad62e4a3efd0d 100644 --- a/lib/util/host-rules.spec.ts +++ b/lib/util/host-rules.spec.ts @@ -40,8 +40,10 @@ describe('util/host-rules', () => { username: 'user1', password: 'pass1', } as any); - // FIXME: explicit assert condition - expect(find({ url: 'https://some.endpoint/v3/' })).toMatchSnapshot(); + expect(find({ url: 'https://some.endpoint/v3/' })).toEqual({ + password: 'pass1', + username: 'user1', + }); }); }); describe('find()', () => { @@ -59,8 +61,7 @@ describe('util/host-rules', () => { password: 'p4$$w0rd', token: undefined, } as any); - // FIXME: explicit assert condition - expect(find({ hostType: datasourceNuget.id })).toMatchSnapshot(); + expect(find({ hostType: datasourceNuget.id })).toEqual({}); expect( find({ hostType: datasourceNuget.id, url: 'https://nuget.org' }) ).not.toEqual({}); @@ -84,10 +85,9 @@ describe('util/host-rules', () => { hostType: datasourceNuget.id, token: 'abc', }); - // FIXME: explicit assert condition expect( find({ hostType: datasourceNuget.id, url: 'https://nuget.local/api' }) - ).toMatchSnapshot(); + ).toEqual({ token: 'abc' }); }); it('matches on domainName', () => { add({ @@ -177,10 +177,9 @@ describe('util/host-rules', () => { hostName: 'nuget.local', token: 'abc', } as any); - // FIXME: explicit assert condition expect( find({ hostType: datasourceNuget.id, url: 'https://nuget.local/api' }) - ).toMatchSnapshot(); + ).toEqual({ token: 'abc' }); }); it('matches on matchHost with protocol', () => { add({ @@ -231,13 +230,12 @@ describe('util/host-rules', () => { matchHost: 'https://nuget.local/api', token: 'abc', } as any); - // FIXME: explicit assert condition expect( find({ hostType: datasourceNuget.id, url: 'https://nuget.local/api/sub-resource', }) - ).toMatchSnapshot(); + ).toEqual({ token: 'abc' }); }); it('returns hosts', () => { add({ @@ -267,8 +265,12 @@ describe('util/host-rules', () => { const res = hosts({ hostType: datasourceNuget.id, }); - expect(res).toMatchSnapshot(); - expect(res).toHaveLength(4); + expect(res).toEqual([ + 'nuget.local', + 'my.local.registry', + 'another.local.registry', + 'yet.another.local.registry', + ]); }); }); describe('findAll()', () => { @@ -283,8 +285,15 @@ describe('util/host-rules', () => { password: 'p4$$w0rd', }; add(hostRule); - expect(findAll({ hostType: 'nuget' })).toHaveLength(1); - expect(findAll({ hostType: 'nuget' })[0]).toMatchSnapshot(); + expect(findAll({ hostType: 'nuget' })).toEqual([ + { + hostType: 'nuget', + password: 'p4$$w0rd', + resolvedHost: 'nuget.org', + username: 'root', + matchHost: 'nuget.org', + }, + ]); }); }); describe('getAll()', () => { diff --git a/lib/util/http/__snapshots__/bitbucket.spec.ts.snap b/lib/util/http/__snapshots__/bitbucket.spec.ts.snap index 06a0200693e03a..e61c4faf084a75 100644 --- a/lib/util/http/__snapshots__/bitbucket.spec.ts.snap +++ b/lib/util/http/__snapshots__/bitbucket.spec.ts.snap @@ -41,21 +41,3 @@ Array [ }, ] `; - -exports[`util/http/bitbucket returns cached 1`] = `Object {}`; - -exports[`util/http/bitbucket returns cached 2`] = ` -Array [ - Object { - "headers": Object { - "accept": "application/json", - "accept-encoding": "gzip, deflate, br", - "authorization": "Bearer token", - "host": "api.bitbucket.org", - "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)", - }, - "method": "GET", - "url": "https://api.bitbucket.org/projects/foo", - }, -] -`; diff --git a/lib/util/http/__snapshots__/index.spec.ts.snap b/lib/util/http/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 13e7e4858f20eb..00000000000000 --- a/lib/util/http/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,87 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`util/http/index deleteJson 1`] = ` -Object { - "authorization": false, - "body": Object {}, - "headers": Object { - "content-type": "application/json", - }, - "statusCode": 200, -} -`; - -exports[`util/http/index get 1`] = ` -Object { - "authorization": false, - "body": "", - "headers": Object {}, - "statusCode": 200, -} -`; - -exports[`util/http/index getJson 1`] = ` -Object { - "authorization": false, - "body": Object { - "test": true, - }, - "headers": Object {}, - "statusCode": 200, -} -`; - -exports[`util/http/index headJson 1`] = ` -Object { - "authorization": false, - "body": Object {}, - "headers": Object { - "content-type": "application/json", - }, - "statusCode": 200, -} -`; - -exports[`util/http/index patchJson 1`] = ` -Object { - "authorization": false, - "body": Object {}, - "headers": Object { - "content-type": "application/json", - }, - "statusCode": 200, -} -`; - -exports[`util/http/index postJson 1`] = ` -Object { - "authorization": false, - "body": Object {}, - "headers": Object { - "content-type": "application/json", - }, - "statusCode": 200, -} -`; - -exports[`util/http/index putJson 1`] = ` -Object { - "authorization": false, - "body": Object {}, - "headers": Object { - "content-type": "application/json", - }, - "statusCode": 200, -} -`; - -exports[`util/http/index retries 1`] = ` -Object { - "authorization": false, - "body": "", - "headers": Object { - "x-some-header": "abc", - }, - "statusCode": 200, -} -`; diff --git a/lib/util/http/bitbucket.spec.ts b/lib/util/http/bitbucket.spec.ts index ae38ead34ebdda..0f16bfe36014bb 100644 --- a/lib/util/http/bitbucket.spec.ts +++ b/lib/util/http/bitbucket.spec.ts @@ -43,11 +43,4 @@ describe('util/http/bitbucket', () => { expect(httpMock.getTrace()).toMatchSnapshot(); }); - it('returns cached', async () => { - httpMock.scope(baseUrl).get('/projects/foo').reply(200, {}); - const { body } = await api.getJson('projects/foo'); - // FIXME: explicit assert condition - expect(body).toMatchSnapshot(); - expect(httpMock.getTrace()).toMatchSnapshot(); - }); }); diff --git a/lib/util/http/index.spec.ts b/lib/util/http/index.spec.ts index b3003dfad468c2..c239376549df87 100644 --- a/lib/util/http/index.spec.ts +++ b/lib/util/http/index.spec.ts @@ -19,8 +19,12 @@ describe('util/http/index', () => { }); it('get', async () => { httpMock.scope(baseUrl).get('/test').reply(200); - // FIXME: explicit assert condition - expect(await http.get('http://renovate.com/test')).toMatchSnapshot(); + expect(await http.get('http://renovate.com/test')).toEqual({ + authorization: false, + body: '', + headers: {}, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); it('returns 429 error', async () => { @@ -54,47 +58,81 @@ describe('util/http/index', () => { }); it('getJson', async () => { httpMock.scope(baseUrl).get('/').reply(200, '{ "test": true }'); - // FIXME: explicit assert condition - expect(await http.getJson('http://renovate.com')).toMatchSnapshot(); + expect(await http.getJson('http://renovate.com')).toEqual({ + authorization: false, + body: { + test: true, + }, + headers: {}, + statusCode: 200, + }); }); it('postJson', async () => { httpMock.scope(baseUrl).post('/').reply(200, {}); - // FIXME: explicit assert condition expect( await http.postJson('http://renovate.com', { body: {}, baseUrl }) - ).toMatchSnapshot(); + ).toEqual({ + authorization: false, + body: {}, + headers: { + 'content-type': 'application/json', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); it('putJson', async () => { httpMock.scope(baseUrl).put('/').reply(200, {}); - // FIXME: explicit assert condition expect( await http.putJson('http://renovate.com', { body: {}, baseUrl }) - ).toMatchSnapshot(); + ).toEqual({ + authorization: false, + body: {}, + headers: { + 'content-type': 'application/json', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); it('patchJson', async () => { httpMock.scope(baseUrl).patch('/').reply(200, {}); - // FIXME: explicit assert condition expect( await http.patchJson('http://renovate.com', { body: {}, baseUrl }) - ).toMatchSnapshot(); + ).toEqual({ + authorization: false, + body: {}, + headers: { + 'content-type': 'application/json', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); it('deleteJson', async () => { httpMock.scope(baseUrl).delete('/').reply(200, {}); - // FIXME: explicit assert condition expect( await http.deleteJson('http://renovate.com', { body: {}, baseUrl }) - ).toMatchSnapshot(); + ).toEqual({ + authorization: false, + body: {}, + headers: { + 'content-type': 'application/json', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); it('headJson', async () => { httpMock.scope(baseUrl).head('/').reply(200, {}); - // FIXME: explicit assert condition - expect( - await http.headJson('http://renovate.com', { baseUrl }) - ).toMatchSnapshot(); + expect(await http.headJson('http://renovate.com', { baseUrl })).toEqual({ + authorization: false, + body: {}, + headers: { + 'content-type': 'application/json', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); }); @@ -133,8 +171,14 @@ describe('util/http/index', () => { .reply(500) .head('/') .reply(200, undefined, { 'x-some-header': 'abc' }); - // FIXME: explicit assert condition - expect(await http.head('http://renovate.com')).toMatchSnapshot(); + expect(await http.head('http://renovate.com')).toEqual({ + authorization: false, + body: '', + headers: { + 'x-some-header': 'abc', + }, + statusCode: 200, + }); expect(httpMock.allUsed()).toBeTrue(); } finally { process.env.NODE_ENV = NODE_ENV; diff --git a/lib/util/markdown.spec.ts b/lib/util/markdown.spec.ts index 022a2535d2943a..0aac8a997bea61 100644 --- a/lib/util/markdown.spec.ts +++ b/lib/util/markdown.spec.ts @@ -2,7 +2,7 @@ import { linkify } from './markdown'; describe('util/markdown', () => { describe('.linkify', () => { - const md = `Some references: + const before = `Some references: * Commit: f8083175fe890cbf14f41d0a06e7aa35d4989587 * Commit (fork): foo@f8083175fe890cbf14f41d0a06e7aa35d4989587 @@ -13,9 +13,21 @@ describe('util/markdown', () => { * Issue or PR (project): remarkjs/remark#1 * Mention: @wooorm `; + + const after = `Some references: + +- Commit: [\`f808317\`](https://github.com/some/repo/commit/f8083175fe890cbf14f41d0a06e7aa35d4989587) +- Commit (fork): [foo@\`f808317\`](https://github.com/foo/repo/commit/f8083175fe890cbf14f41d0a06e7aa35d4989587) +- Commit (repo): [remarkjs/remark@\`e1aa9f6\`](https://github.com/remarkjs/remark/commit/e1aa9f6c02de18b9459b7d269712bcb50183ce89) +- Issue or PR (\`#\`): [#1](https://github.com/some/repo/issues/1) +- Issue or PR (\`GH-\`): [GH-1](https://github.com/some/repo/issues/1) +- Issue or PR (fork): [foo#1](https://github.com/foo/repo/issues/1) +- Issue or PR (project): [remarkjs/remark#1](https://github.com/remarkjs/remark/issues/1) +- Mention: [@wooorm](https://github.com/wooorm) +`; + it('works', async () => { - // FIXME: explicit assert condition - expect(await linkify(md, { repository: 'some/repo' })).toMatchSnapshot(); + expect(await linkify(before, { repository: 'some/repo' })).toEqual(after); }); }); }); diff --git a/lib/util/package-rules.spec.ts b/lib/util/package-rules.spec.ts index 39cce745fb9cc8..2d8d0d22268c5f 100644 --- a/lib/util/package-rules.spec.ts +++ b/lib/util/package-rules.spec.ts @@ -65,8 +65,10 @@ describe('util/package-rules', () => { }, ], }; - // FIXME: explicit assert condition - expect(applyPackageRules(config)).toMatchSnapshot(); + expect(applyPackageRules(config)).toEqual({ + ...config, + matchUpdateTypes: ['bump'], + }); }); it('applies both rules for a', () => { const dep = { @@ -709,10 +711,10 @@ describe('util/package-rules', () => { expect(res3.x).toBeDefined(); }); it('empty rules', () => { - // FIXME: explicit assert condition - expect( - applyPackageRules({ ...config1, packageRules: null }) - ).toMatchSnapshot(); + expect(applyPackageRules({ ...config1, packageRules: null })).toEqual({ + foo: 'bar', + packageRules: null, + }); }); it('creates groupSlug if necessary', () => {