Skip to content

Commit

Permalink
test: add snapshot for package.json updates
Browse files Browse the repository at this point in the history
test: fix test
  • Loading branch information
chingor13 committed Nov 6, 2023
1 parent 62197c6 commit 2f24e58
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
31 changes: 31 additions & 0 deletions __snapshots__/node-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,37 @@ Release notes for path: ., releaseType: node
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
`

exports['NodeWorkspace plugin run combines node packages 2'] = `
{
"name": "@here/root",
"version": "5.5.6",
"dependencies": {
"@here/pkgA": "^3.3.4",
"@here/pkgD": "^4.4.5"
}
}
`

exports['NodeWorkspace plugin run combines node packages 3'] = `
{
"name": "@here/pkgA",
"version": "3.3.4",
"dependencies": {
"anotherExternal": "^4.3.1"
}
}
`

exports['NodeWorkspace plugin run combines node packages 4'] = `
{
"name": "@here/pkgD",
"version": "4.4.5",
"dependencies": {
"anotherExternal": "^4.3.1"
}
}
`

exports['NodeWorkspace plugin run handles a single node package 1'] = `
:robot: I have created a release *beep* *boop*
---
Expand Down
8 changes: 4 additions & 4 deletions test/plugins/node-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe('NodeWorkspace plugin', () => {
),
],
}),
buildMockCandidatePullRequest('node1', 'node', '2.2.2', {
buildMockCandidatePullRequest('node1', 'node', '3.3.3', {
component: '@here/pkgA',
updates: [
buildMockPackageUpdate('node1/package.json', 'node1/package.json'),
Expand Down Expand Up @@ -255,10 +255,10 @@ describe('NodeWorkspace plugin', () => {
);
expect(nodeCandidate).to.not.be.undefined;
const updates = nodeCandidate!.pullRequest.updates;
assertHasUpdate(updates, 'package.json');
assertHasUpdate(updates, 'node1/package.json');
assertHasUpdate(updates, 'node4/package.json');
snapshot(dateSafe(nodeCandidate!.pullRequest.body.toString()));
snapshotUpdate(updates, 'package.json');
snapshotUpdate(updates, 'node1/package.json');
snapshotUpdate(updates, 'node4/package.json');
});
it('walks dependency tree and updates previously untouched packages', async () => {
const candidates: CandidateReleasePullRequest[] = [
Expand Down

0 comments on commit 2f24e58

Please sign in to comment.