Skip to content

Commit

Permalink
Change files
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Nov 18, 2024
1 parent 8b01729 commit 55661a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions change/beachball-f72ae41e-d073-44c8-913c-699450fe9a0d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"comment": "Add v0-specific change descriptions",
"type": "minor",
"packageName": "beachball",
"email": "[email protected]",
"dependentChangeType": "patch"
}
20 changes: 10 additions & 10 deletions src/__e2e__/change.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('change command', () => {
await waitForPrompt();

// Use default change type and custom message
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo (currently v1.0.0)');
await stdin.sendByChar('\n');
// Also verify that the options shown are correct
expect(stdout.lastOutput()).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('change command', () => {
const options = getOptions();
const changePromise = change(options);

expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo (currently v1.0.0)');
await stdin.sendByChar('\n'); // default change type
await stdin.sendByChar('commit me please\n'); // custom message
await changePromise;
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('change command', () => {
});
const changePromise = change(options);

expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo (currently v1.0.0)');
await stdin.sendByChar('\n'); // default change type
await stdin.sendByChar('commit me please\n'); // custom message
await changePromise;
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('change command', () => {
const changePromise = change(options);
await waitForPrompt();

expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: foo (currently v1.0.0)');
await stdin.sendByChar('\n'); // default change type
await stdin.sendByChar('stage me please\n'); // custom message
await changePromise;
Expand All @@ -218,7 +218,7 @@ describe('change command', () => {
const changePromise = change(options);

// use custom values for first package
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1 (currently v1.0.0)');
stdin.emitKey({ name: 'down' });
await stdin.sendByChar('\n');
// also verify that the options shown are correct
Expand All @@ -230,7 +230,7 @@ describe('change command', () => {
await stdin.sendByChar('custom\n');

// use defaults for second package
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2 (currently v1.0.0)');
await stdin.sendByChar('\n\n');

await changePromise;
Expand Down Expand Up @@ -260,13 +260,13 @@ describe('change command', () => {
const changePromise = change(options);

// use custom values for first package
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1 (currently v1.0.0)');
stdin.emitKey({ name: 'down' });
await stdin.sendByChar('\n');
await stdin.sendByChar('custom\n');

// use defaults for second package
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2 (currently v1.0.0)');
await stdin.sendByChar('\n\n');

await changePromise;
Expand Down Expand Up @@ -305,13 +305,13 @@ describe('change command', () => {
const changePromise = change(options);
await waitForPrompt();

expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-1 (currently v1.0.0)');
expect(stdout.lastOutput()).toMatch(/Change type/);
await stdin.sendByChar('\n');
expect(stdout.lastOutput()).toMatch(/Describe changes/);
await stdin.sendByChar('\n');

expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2');
expect(logs.mocks.log).toHaveBeenLastCalledWith('Please describe the changes for: pkg-2 (currently v1.0.0)');
expect(stdout.lastOutput()).toMatch(/custom question/);
await stdin.sendByChar('stuff\n');
expect(stdout.lastOutput()).toMatch(/Change type/);
Expand Down

0 comments on commit 55661a6

Please sign in to comment.