mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-16 07:48:06 +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,12 +60,29 @@ describe('Git', function() {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Switches', function() {
|
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(
|
return expectTreeAsync(
|
||||||
'git switch -c side',
|
'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"}}'
|
'{"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() {
|
it('Rebases', function() {
|
||||||
return expectTreeAsync(
|
return expectTreeAsync(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue