Skip to content

Commit

Permalink
test: add snapshot for package.json updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Nov 6, 2023
1 parent 62197c6 commit d751a38
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 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
6 changes: 3 additions & 3 deletions test/plugins/node-workspace.ts
Original file line number Diff line number Diff line change
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 d751a38

Please sign in to comment.