mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
Refactor git switch tests
This commit is contained in:
parent
78083c4a0a
commit
8a3dd90e35
1 changed files with 22 additions and 5 deletions
|
@ -60,11 +60,28 @@ describe('Git', function() {
|
|||
);
|
||||
});
|
||||
|
||||
it('Switches', function() {
|
||||
return expectTreeAsync(
|
||||
'git switch -c side',
|
||||
'{"branches":{"main":{"target":"C1","id":"main"},"side":{"target":"C1","id":"side"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"side","id":"HEAD"}}'
|
||||
);
|
||||
describe('Switches', function() {
|
||||
it("to a commit", function () {
|
||||
return expectTreeAsync(
|
||||
'git switch C0',
|
||||
'{"branches":{"main":{"target":"C1","id":"main"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"C0","id":"HEAD"}}'
|
||||
);
|
||||
});
|
||||
|
||||
it("to a branch", function () {
|
||||
return expectTreeAsync(
|
||||
'git switch side',
|
||||
'{"branches":{"main":{"target":"C1","id":"main"},"side":{"target":"C1","id":"side"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"side","id":"HEAD"}}',
|
||||
'{"branches":{"main":{"target":"C1","id":"main"},"side":{"target":"C1","id":"side"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"main","id":"HEAD"}}'
|
||||
);
|
||||
});
|
||||
|
||||
it('to a branch with -c option', function() {
|
||||
return expectTreeAsync(
|
||||
'git switch -c side',
|
||||
'{"branches":{"main":{"target":"C1","id":"main"},"side":{"target":"C1","id":"side"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"side","id":"HEAD"}}'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('Rebases', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue