Skip to content

Commit

Permalink
fix(manager:npm): fix yarn lockfile version replacement (#15116)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 14, 2022
1 parent 97e3835 commit 59dbcfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
expect(addedSections).toHaveLength(1);
expect(removedSections).toHaveLength(1);
expect(addedSections[0].value).toMatchInlineSnapshot(`
" version: \\"0.2.5\\"
" version \\"0.2.5\\"
"
`);
expect(removedSections[0].value).toMatchInlineSnapshot(`
Expand All @@ -57,7 +57,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
expect(addedSections).toHaveLength(1);
expect(removedSections).toHaveLength(1);
expect(addedSections[0].value).toMatchInlineSnapshot(`
" version: \\"4.4.0\\"
" version \\"4.4.0\\"
"
`);
expect(removedSections[0].value).toMatchInlineSnapshot(`
Expand All @@ -84,7 +84,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
expect(removedSections).toHaveLength(1);
expect(addedSections[0].value).toMatchInlineSnapshot(`
"express@4.4.0:
version: \\"4.4.0\\"
version \\"4.4.0\\"
"
`);
expect(removedSections[0].value).toMatchInlineSnapshot(`
Expand All @@ -110,7 +110,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
expect(addedSections).toHaveLength(1);
expect(removedSections).toHaveLength(1);
expect(addedSections[0].value).toMatchInlineSnapshot(`
" version: \\"2.2.0\\"
" version \\"2.2.0\\"
"
`);
expect(removedSections[0].value).toMatchInlineSnapshot(`
Expand All @@ -136,7 +136,7 @@ describe('modules/manager/npm/update/locked-dependency/yarn-lock/replace', () =>
expect(addedSections).toHaveLength(1);
expect(removedSections).toHaveLength(1);
expect(addedSections[0].value).toMatchInlineSnapshot(`
" version: \\"0.48.1\\"
" version \\"0.48.1\\"
"
`);
expect(removedSections[0].value).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ export function replaceConstraintVersion(
}
return lockFileContent.replace(
regEx(matchString),
`${constraintLine} version: "${newVersion}"\n$5`
`${constraintLine} version "${newVersion}"\n$5`
);
}

0 comments on commit 59dbcfd

Please sign in to comment.