diff --git a/lib/modules/manager/flux/extract.spec.ts b/lib/modules/manager/flux/extract.spec.ts index 331bd4c3ea23e25beace3a697606a7af382b4ac9..e229baaec87290bcfa73f8c2b0889418d74c811e 100644 --- a/lib/modules/manager/flux/extract.spec.ts +++ b/lib/modules/manager/flux/extract.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { Fixtures } from '../../../../test/fixtures'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; @@ -86,11 +87,12 @@ describe('modules/manager/flux/extract', () => { it('ignores HelmRepository resources without metadata', () => { const result = extractPackageFile( - `${Fixtures.get('release.yaml')} ---- -apiVersion: source.toolkit.fluxcd.io/v1beta1 -kind: HelmRepository -`, + codeBlock` + ${Fixtures.get('release.yaml')} + --- + apiVersion: source.toolkit.fluxcd.io/v1beta1 + kind: HelmRepository + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -98,19 +100,20 @@ kind: HelmRepository it('ignores HelmRelease resources without a chart name', () => { const result = extractPackageFile( - `apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: sealed-secrets - namespace: kube-system -spec: - chart: - spec: - sourceRef: - kind: HelmRepository - name: sealed-secrets - version: "2.0.2" -`, + codeBlock` + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + metadata: + name: sealed-secrets + namespace: kube-system + spec: + chart: + spec: + sourceRef: + kind: HelmRepository + name: sealed-secrets + version: "2.0.2" + `, 'test.yaml' ); expect(result).toBeNull(); @@ -118,24 +121,25 @@ spec: it('does not match HelmRelease resources without a namespace to HelmRepository resources without a namespace', () => { const result = extractPackageFile( - `apiVersion: source.toolkit.fluxcd.io/v1beta1 -kind: HelmRepository -metadata: - name: sealed-secrets -spec: - url: https://bitnami-labs.github.io/sealed-secrets ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -spec: - chart: - spec: - chart: sealed-secrets - sourceRef: - kind: HelmRepository - name: sealed-secrets - version: "2.0.2" -`, + codeBlock` + apiVersion: source.toolkit.fluxcd.io/v1beta1 + kind: HelmRepository + metadata: + name: sealed-secrets + spec: + url: https://bitnami-labs.github.io/sealed-secrets + --- + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + spec: + chart: + spec: + chart: sealed-secrets + sourceRef: + kind: HelmRepository + name: sealed-secrets + version: "2.0.2" + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -143,18 +147,19 @@ spec: it('does not match HelmRelease resources without a sourceRef', () => { const result = extractPackageFile( - `${Fixtures.get('source.yaml')} ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: sealed-secrets -spec: - chart: - spec: - chart: sealed-secrets - version: "2.0.2" -`, + codeBlock` + ${Fixtures.get('source.yaml')} + --- + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + metadata: + name: sealed-secrets + spec: + chart: + spec: + chart: sealed-secrets + version: "2.0.2" + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -162,19 +167,20 @@ spec: it('does not match HelmRelease resources without a namespace', () => { const result = extractPackageFile( - `${Fixtures.get('source.yaml')} ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -spec: - chart: - spec: - chart: sealed-secrets - sourceRef: - kind: HelmRepository - name: sealed-secrets - version: "2.0.2" -`, + codeBlock` + ${Fixtures.get('source.yaml')} + --- + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + spec: + chart: + spec: + chart: sealed-secrets + sourceRef: + kind: HelmRepository + name: sealed-secrets + version: "2.0.2" + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -182,13 +188,14 @@ spec: it('ignores HelmRepository resources without a namespace', () => { const result = extractPackageFile( - `${Fixtures.get('release.yaml')} ---- -apiVersion: source.toolkit.fluxcd.io/v1beta1 -kind: HelmRepository -metadata: - name: test -`, + codeBlock` + ${Fixtures.get('release.yaml')} + --- + apiVersion: source.toolkit.fluxcd.io/v1beta1 + kind: HelmRepository + metadata: + name: test + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -196,14 +203,15 @@ metadata: it('ignores HelmRepository resources without a URL', () => { const result = extractPackageFile( - `${Fixtures.get('release.yaml')} ---- -apiVersion: source.toolkit.fluxcd.io/v1beta1 -kind: HelmRepository -metadata: - name: sealed-secrets - namespace: kube-system -`, + codeBlock` + ${Fixtures.get('release.yaml')} + --- + apiVersion: source.toolkit.fluxcd.io/v1beta1 + kind: HelmRepository + metadata: + name: sealed-secrets + namespace: kube-system + `, 'test.yaml' ); expect(result?.deps[0].skipReason).toBe('unknown-registry'); @@ -211,8 +219,10 @@ metadata: it('ignores resources of an unknown kind', () => { const result = extractPackageFile( - `kind: SomethingElse -apiVersion: helm.toolkit.fluxcd.io/v2beta1`, + codeBlock` + kind: SomethingElse + apiVersion: helm.toolkit.fluxcd.io/v2beta1 + `, 'test.yaml' ); expect(result).toBeNull(); diff --git a/lib/modules/manager/gomod/artifacts.spec.ts b/lib/modules/manager/gomod/artifacts.spec.ts index 57a780defaa4e8cfaddfa1219f3c85cbac711271..296abbaefafcdea2622b581514555d9f57844a5f 100644 --- a/lib/modules/manager/gomod/artifacts.spec.ts +++ b/lib/modules/manager/gomod/artifacts.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { join } from 'upath'; import { envMock, mockExecAll } from '../../../../test/exec-util'; import { env, fs, git, mocked } from '../../../../test/util'; @@ -22,25 +23,25 @@ process.env.BUILDPACK = 'true'; const datasource = mocked(_datasource); const hostRules = mocked(_hostRules); -const gomod1 = `module github.com/renovate-tests/gomod1 +const gomod1 = codeBlock` + module github.com/renovate-tests/gomod1 -require github.com/pkg/errors v0.7.0 -require github.com/aws/aws-sdk-go v1.15.21 -require github.com/davecgh/go-spew v1.0.0 -require golang.org/x/foo v1.0.0 -require github.com/rarkins/foo abcdef1 -require gopkg.in/russross/blackfriday.v1 v1.0.0 -require go.uber.org/zap v1.20.0 + require github.com/pkg/errors v0.7.0 + require github.com/aws/aws-sdk-go v1.15.21 + require github.com/davecgh/go-spew v1.0.0 + require golang.org/x/foo v1.0.0 + require github.com/rarkins/foo abcdef1 + require gopkg.in/russross/blackfriday.v1 v1.0.0 + require go.uber.org/zap v1.20.0 -replace github.com/pkg/errors => ../errors + replace github.com/pkg/errors => ../errors -replace (golang.org/x/foo => github.com/pravesht/gocql v0.0.0) - -replace ( - // TODO: this comment breaks renovatebot (>v0.11.1) - go.uber.org/zap => go.uber.org/zap v1.21.0 -) + replace (golang.org/x/foo => github.com/pravesht/gocql v0.0.0) + replace ( + // TODO: this comment breaks renovatebot (>v0.11.1) + go.uber.org/zap => go.uber.org/zap v1.21.0 + ) `; const adminConfig: RepoGlobalConfig = { diff --git a/lib/modules/manager/hermit/update.spec.ts b/lib/modules/manager/hermit/update.spec.ts index e38494535ed0029702188fe0d9329589acd85f98..a3f3071a9b3fa3ec82077505c6bf205b3dd9e217 100644 --- a/lib/modules/manager/hermit/update.spec.ts +++ b/lib/modules/manager/hermit/update.spec.ts @@ -1,19 +1,23 @@ +import { codeBlock } from 'common-tags'; import { updateDependency } from '.'; describe('modules/manager/hermit/update', () => { describe('updateDependency', () => { it('should append a new marking line at the end to trigger the artifact update', () => { - const fileContent = `#!/bin/bash -#some hermit content -`; + const fileContent = codeBlock` + #!/bin/bash + #some hermit content + `; const ret = updateDependency({ fileContent, upgrade: {} }); expect(ret).toBe(`${fileContent}\n#hermit updated`); }); it('should not update again if the new line has been appended', () => { - const fileContent = `#!/bin/bash -#some hermit content -#hermit updated`; + const fileContent = codeBlock` + #!/bin/bash + #some hermit content + #hermit updated + `; const ret = updateDependency({ fileContent, upgrade: {} }); expect(ret).toBe(`${fileContent}`); }); diff --git a/lib/modules/manager/mint/extract.spec.ts b/lib/modules/manager/mint/extract.spec.ts index 707907bfc837682dd2cde1a0e6e0fa9062037254..66faefe37720f7484519b6703d25a6ba88d46d93 100644 --- a/lib/modules/manager/mint/extract.spec.ts +++ b/lib/modules/manager/mint/extract.spec.ts @@ -1,33 +1,15 @@ +import { codeBlock } from 'common-tags'; import { extractPackageFile } from '.'; -const simpleMintfile = ` -SwiftGen/SwiftGen@6.6.1 -yonaskolb/xcodegen@2.30.0 -realm/SwiftLint @ 0.48.0 -#realm/SwiftLint @ 0.48.0 -`; - -const noVersionMintfileContent = ` -yonaskolb/xcodegen -realm/SwiftLint -`; - -const complexMintFileContent = ` -SwiftGen/SwiftGen@6.6.1 -yonaskolb/xcodegen -realm/SwiftLint @ 0.48.0`; - -const includesCommentedOutMintFileContent = ` -SwiftGen/SwiftGen@6.6.1 -yonaskolb/xcodegen -#yonaskolb/xcodegen -realm/SwiftLint@0.48.0 #commented out -`; - describe('modules/manager/mint/extract', () => { describe('extractPackageFile()', () => { it('Mintfile With Version Description', () => { - const res = extractPackageFile(simpleMintfile); + const res = extractPackageFile(codeBlock` + SwiftGen/SwiftGen@6.6.1 + yonaskolb/xcodegen@2.30.0 + realm/SwiftLint @ 0.48.0 + #realm/SwiftLint @ 0.48.0 + `); expect(res).toEqual({ deps: [ { @@ -53,7 +35,10 @@ describe('modules/manager/mint/extract', () => { }); it('Mintfile Without Version Description', () => { - const res = extractPackageFile(noVersionMintfileContent); + const res = extractPackageFile(codeBlock` + yonaskolb/xcodegen + realm/SwiftLint + `); expect(res).toEqual({ deps: [ { @@ -69,7 +54,11 @@ describe('modules/manager/mint/extract', () => { }); it('Complex Mintfile', () => { - const res = extractPackageFile(complexMintFileContent); + const res = extractPackageFile(codeBlock` + SwiftGen/SwiftGen@6.6.1 + yonaskolb/xcodegen + realm/SwiftLint @ 0.48.0 + `); expect(res).toEqual({ deps: [ { @@ -93,7 +82,13 @@ describe('modules/manager/mint/extract', () => { }); it('Mintfile Includes Commented Out', () => { - const res = extractPackageFile(includesCommentedOutMintFileContent); + const res = extractPackageFile(codeBlock` + SwiftGen/SwiftGen@6.6.1 + + yonaskolb/xcodegen + #yonaskolb/xcodegen + realm/SwiftLint@0.48.0 #commented out + `); expect(res).toEqual({ deps: [ { diff --git a/lib/modules/manager/terraform/extract.spec.ts b/lib/modules/manager/terraform/extract.spec.ts index 49072138eb2538396abdb1cfb7d760df15efa2f8..48bbcb6cfbfc34f2b9005617c4e644f1e94fedef 100644 --- a/lib/modules/manager/terraform/extract.spec.ts +++ b/lib/modules/manager/terraform/extract.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { join } from 'upath'; import { Fixtures } from '../../../../test/fixtures'; import { fs } from '../../../../test/util'; @@ -12,10 +13,6 @@ const providers = Fixtures?.get('providers.tf'); const docker = Fixtures?.get('docker.tf'); const kubernetes = Fixtures?.get('kubernetes.tf'); -const tf2 = `module "relative" { - source = "../fe" -} -`; const helm = Fixtures?.get('helm.tf'); const lockedVersion = Fixtures?.get('lockedVersion.tf'); const lockedVersionLockfile = Fixtures?.get('rangeStrategy.hcl'); @@ -205,7 +202,12 @@ describe('modules/manager/terraform/extract', () => { }); it('returns null if only local deps', async () => { - expect(await extractPackageFile(tf2, '2.tf', {})).toBeNull(); + const src = codeBlock` + module "relative" { + source = "../fe" + } + `; + expect(await extractPackageFile(src, '2.tf', {})).toBeNull(); }); it('extract helm releases', async () => { diff --git a/lib/modules/manager/tflint-plugin/extract.spec.ts b/lib/modules/manager/tflint-plugin/extract.spec.ts index 04e2dccda3a42112c7ec5e828f2b9299831cae0a..b2ff137d6355353f1424d09a1c619fd9754e827b 100644 --- a/lib/modules/manager/tflint-plugin/extract.spec.ts +++ b/lib/modules/manager/tflint-plugin/extract.spec.ts @@ -1,74 +1,9 @@ +import { codeBlock } from 'common-tags'; import { join } from 'upath'; import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import { extractPackageFile } from '.'; -const configNormal = ` -plugin "foo" { - enabled = true - version = "0.1.0" - source = "github.com/org/tflint-ruleset-foo" -} - -plugin "bar" { - enabled = true - version = "1.42.0" - source = "github.com/org2/tflint-ruleset-bar" -} -`; - -const configNoVersion = ` -plugin "bundled" {} -`; - -const configFull = ` -config { - format = "compact" - plugin_dir = "~/.tflint.d/plugins" - - module = true - force = false - disabled_by_default = false - - ignore_module = { - "terraform-aws-modules/vpc/aws" = true - "terraform-aws-modules/security-group/aws" = true - } - - varfile = ["example1.tfvars", "example2.tfvars"] -} - -plugin "aws" { - enabled = true - version = "0.4.0" - source = "github.com/terraform-linters/tflint-ruleset-aws" -} - -rule "aws_instance_invalid_type" { - enabled = false -} -`; - -const noSource = ` -plugin "aws" { - enabled = true - version = "0.4.0" -} - -plugin "bundled" { - # A bundled plugin, probably. - enabled = true -} -`; - -const notGithub = ` -plugin "aws" { - enabled = true - version = "0.4.0" - source = "gitlab.com/terraform-linters/tflint-ruleset-aws" -} -`; - const adminConfig: RepoGlobalConfig = { localDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), @@ -91,12 +26,29 @@ describe('modules/manager/tflint-plugin/extract', () => { }); it('returns null when there are no version', () => { + const configNoVersion = codeBlock` + plugin "bundled" {} + `; + expect( extractPackageFile(configNoVersion, 'doesnt-exist.hcl', {}) ).toBeNull(); }); it('extracts plugins', () => { + const configNormal = codeBlock` + plugin "foo" { + enabled = true + version = "0.1.0" + source = "github.com/org/tflint-ruleset-foo" + } + + plugin "bar" { + enabled = true + version = "1.42.0" + source = "github.com/org2/tflint-ruleset-bar" + } + `; const res = extractPackageFile(configNormal, 'tflint-1.hcl', {}); expect(res).toEqual({ deps: [ @@ -117,6 +69,33 @@ describe('modules/manager/tflint-plugin/extract', () => { }); it('extracts from full configuration', () => { + const configFull = codeBlock` + config { + format = "compact" + plugin_dir = "~/.tflint.d/plugins" + + module = true + force = false + disabled_by_default = false + + ignore_module = { + "terraform-aws-modules/vpc/aws" = true + "terraform-aws-modules/security-group/aws" = true + } + + varfile = ["example1.tfvars", "example2.tfvars"] + } + + plugin "aws" { + enabled = true + version = "0.4.0" + source = "github.com/terraform-linters/tflint-ruleset-aws" + } + + rule "aws_instance_invalid_type" { + enabled = false + } + `; const res = extractPackageFile(configFull, 'tflint-full.hcl', {}); expect(res).toEqual({ deps: [ @@ -131,6 +110,18 @@ describe('modules/manager/tflint-plugin/extract', () => { }); it('extracts no source', () => { + const noSource = codeBlock` + plugin "aws" { + enabled = true + version = "0.4.0" + } + + plugin "bundled" { + # A bundled plugin, probably. + enabled = true + } + `; + const res = extractPackageFile(noSource, 'tflint-no-source.hcl', {}); expect(res).toEqual({ deps: [ @@ -145,6 +136,13 @@ describe('modules/manager/tflint-plugin/extract', () => { }); it('extracts nothing if not from github', () => { + const notGithub = codeBlock` + plugin "aws" { + enabled = true + version = "0.4.0" + source = "gitlab.com/terraform-linters/tflint-ruleset-aws" + } + `; const res = extractPackageFile(notGithub, 'tflint-not-github.hcl', {}); expect(res).toEqual({ deps: [ diff --git a/lib/util/git/errors.spec.ts b/lib/util/git/errors.spec.ts index 19e3696a6e46069a9c4608c90379d3ae1a9ec6e9..beef4491e9f4ccc597712a52cbb83b8fb717576a 100644 --- a/lib/util/git/errors.spec.ts +++ b/lib/util/git/errors.spec.ts @@ -1,15 +1,16 @@ +import { codeBlock } from 'common-tags'; import { bulkChangesDisallowed } from './error'; -const errorMsg = ` -To https://github.com/the-org/st-mono.git -!\t:refs/renovate/branches/renovate/foo\t[remote failure] (remote failed to report status) -!\t:refs/renovate/branches/renovate/bar\t[remote failure] (remote failed to report status) -Done -Pushing to https://github.com/foo/bar.git -POST git-receive-pack (1234 bytes) -remote: Repository policies do not allow pushes that update more than 2 branches or tags. -error: failed to push some refs to 'https://github.com/foo/bar.git' -`.trimStart(); +const errorMsg = codeBlock` + To https://github.com/the-org/st-mono.git + !\t:refs/renovate/branches/renovate/foo\t[remote failure] (remote failed to report status) + !\t:refs/renovate/branches/renovate/bar\t[remote failure] (remote failed to report status) + Done + Pushing to https://github.com/foo/bar.git + POST git-receive-pack (1234 bytes) + remote: Repository policies do not allow pushes that update more than 2 branches or tags. + error: failed to push some refs to 'https://github.com/foo/bar.git' +`; describe('util/git/errors', () => { describe('bulkChangesDisallowed', () => { diff --git a/lib/util/http/github.spec.ts b/lib/util/http/github.spec.ts index 6096fc01d18d441decaeca187d1afe757350e400..8a56df0207a6a7b0931aaee9c3db66eed4b7dfd8 100644 --- a/lib/util/http/github.spec.ts +++ b/lib/util/http/github.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { DateTime } from 'luxon'; import * as httpMock from '../../../test/http-mock'; import { mocked } from '../../../test/util'; @@ -20,30 +21,30 @@ const repositoryCache = mocked(_repositoryCache); const githubApiHost = 'https://api.github.com'; -const graphqlQuery = ` -query( - $owner: String!, - $name: String!, - $count: Int, - $cursor: String -) { - repository(owner: $name, name: $name) { - testItem ( - orderBy: { field: UPDATED_AT, direction: DESC }, - filterBy: { createdBy: "someone" }, - first: $count, - after: $cursor, - ) { - pageInfo { - endCursor - hasNextPage - } - nodes { - number state title body +const graphqlQuery = codeBlock` + query( + $owner: String!, + $name: String!, + $count: Int, + $cursor: String + ) { + repository(owner: $name, name: $name) { + testItem ( + orderBy: { field: UPDATED_AT, direction: DESC }, + filterBy: { createdBy: "someone" }, + first: $count, + after: $cursor, + ) { + pageInfo { + endCursor + hasNextPage + } + nodes { + number state title body + } } } } -} `; describe('util/http/github', () => { diff --git a/lib/util/markdown.spec.ts b/lib/util/markdown.spec.ts index f608ddce11438f87e974791eda1120d4bb468a1f..6a0793e1abaaca49ec6faeae0d688138f84a487c 100644 --- a/lib/util/markdown.spec.ts +++ b/lib/util/markdown.spec.ts @@ -1,34 +1,39 @@ +import { codeBlock } from 'common-tags'; import { Fixtures } from '../../test/fixtures'; import { linkify, sanitizeMarkdown } from './markdown'; describe('util/markdown', () => { describe('.linkify', () => { - const before = `Some references: + const before = codeBlock` + Some references: -* Commit: f8083175fe890cbf14f41d0a06e7aa35d4989587 -* Commit (fork): foo@f8083175fe890cbf14f41d0a06e7aa35d4989587 -* Commit (repo): remarkjs/remark@e1aa9f6c02de18b9459b7d269712bcb50183ce89 -* Issue or PR (\`#\`): #1 -* Issue or PR (\`GH-\`): GH-1 -* Issue or PR (fork): foo#1 -* Issue or PR (project): remarkjs/remark#1 -* Mention: @wooorm -`; + * Commit: f8083175fe890cbf14f41d0a06e7aa35d4989587 + * Commit (fork): foo@f8083175fe890cbf14f41d0a06e7aa35d4989587 + * Commit (repo): remarkjs/remark@e1aa9f6c02de18b9459b7d269712bcb50183ce89 + * Issue or PR (\`#\`): #1 + * Issue or PR (\`GH-\`): GH-1 + * Issue or PR (fork): foo#1 + * Issue or PR (project): remarkjs/remark#1 + * Mention: @wooorm + `; - const after = `Some references: + const after = + codeBlock` + 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) -`; + - 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) + ` + '\n'; it('works', async () => { - expect(await linkify(before, { repository: 'some/repo' })).toEqual(after); + const res = await linkify(before, { repository: 'some/repo' }); + expect(res).toEqual(after); }); it('sanitizeMarkdown check massaged release notes', () => { diff --git a/package.json b/package.json index 3100edb079f7fcde6e604ebcb7ca24bd159ac307..d6113dd76766710aa7d677c8d2e94f62ee15a89a 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,6 @@ "@breejs/later": "4.1.0", "@cheap-glitch/mi-cron": "1.0.1", "@iarna/toml": "3.0.0", - "@renovatebot/osv-offline": "1.0.6", "@opentelemetry/api": "1.2.0", "@opentelemetry/context-async-hooks": "1.7.0", "@opentelemetry/exporter-trace-otlp-http": "0.33.0", @@ -155,6 +154,7 @@ "@opentelemetry/sdk-trace-base": "1.7.0", "@opentelemetry/sdk-trace-node": "1.7.0", "@opentelemetry/semantic-conventions": "1.7.0", + "@renovatebot/osv-offline": "1.0.6", "@renovatebot/pep440": "2.1.5", "@renovatebot/ruby-semver": "1.1.7", "@sindresorhus/is": "4.6.0", @@ -254,6 +254,7 @@ "@types/callsite": "1.0.31", "@types/changelog-filename-regex": "2.0.0", "@types/clean-git-ref": "2.0.0", + "@types/common-tags": "1.8.1", "@types/conventional-commits-detector": "1.0.0", "@types/diff": "5.0.2", "@types/eslint": "8.4.10", @@ -286,6 +287,7 @@ "@typescript-eslint/parser": "5.42.1", "aws-sdk-client-mock": "2.0.0", "callsite": "1.0.0", + "common-tags": "1.8.2", "conventional-changelog-conventionalcommits": "5.0.0", "cross-env": "7.0.3", "diff": "5.1.0", diff --git a/yarn.lock b/yarn.lock index ba6be61eada40b592649e53c9d91f52c4d0fc1f1..8bc6529b785422ca285c40b8d332acce848393da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2831,6 +2831,11 @@ resolved "https://registry.yarnpkg.com/@types/clean-git-ref/-/clean-git-ref-2.0.0.tgz#309687ad1bcdd7012025b5bc76e7a209c378fb63" integrity sha512-dVoH5zxekPWDBllQ+tpBoSfCVnmOt9JYBbPqtl0YvR0twDrgQ4qGEd1ZqPvAe7SGSALcIXl54bhE+cH7Px3g+A== +"@types/common-tags@1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@types/common-tags/-/common-tags-1.8.1.tgz#a5a49ca5ebbb58e0f8947f3ec98950c8970a68a9" + integrity sha512-20R/mDpKSPWdJs5TOpz3e7zqbeCNuMCPhV7Yndk9KU2Rbij2r5W4RzwDPkzC+2lzUqXYu9rFzTktCBnDjHuNQg== + "@types/conventional-commits-detector@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/conventional-commits-detector/-/conventional-commits-detector-1.0.0.tgz#27e143c481d6fa6146863d77e6b91de877d4f09e" @@ -4184,6 +4189,11 @@ common-ancestor-path@^1.0.1: resolved "https://registry.yarnpkg.com/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz#4f7d2d1394d91b7abdf51871c62f71eadb0182a7" integrity sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w== +common-tags@1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" + integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== + compare-func@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3"