mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
More tests for the submodule cases.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
Frontend environments evolve rapidly nowadays, modern browsers have already implemented a great deal of DOM/BOM APIs which are good enough. We don't have to learn jQuery from scratch for DOM manipulation or events. In the meantime, thanks to the prevailment of frontend libraries such as React, Angular and Vue, manipulating DOM directly becomes anti-pattern, jQuery has never been less important. This project summarizes most of the jQuery method alternatives in native implementation, with IE 10+ support.
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Query Selector](#query-selector)
|
||||
|
||||
9
spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/COMMIT_EDITMSG
vendored
Normal file
9
spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/COMMIT_EDITMSG
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
whitespace is nicespace
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
# On branch master
|
||||
# Your branch is up-to-date with 'origin/master'.
|
||||
#
|
||||
# Changes to be committed:
|
||||
# modified: README.md
|
||||
#
|
||||
Binary file not shown.
@@ -1 +1,2 @@
|
||||
0000000000000000000000000000000000000000 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a joshaber <joshaber@gmail.com> 1452186236 -0500 clone: from https://github.com/oneuijs/You-Dont-Need-jQuery
|
||||
2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a a78b35a896b890f0a2a4f1f924c5739776415250 joshaber <joshaber@gmail.com> 1452202510 -0500 commit: whitespace is nicespace
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
0000000000000000000000000000000000000000 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a joshaber <joshaber@gmail.com> 1452186236 -0500 clone: from https://github.com/oneuijs/You-Dont-Need-jQuery
|
||||
2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a a78b35a896b890f0a2a4f1f924c5739776415250 joshaber <joshaber@gmail.com> 1452202510 -0500 commit: whitespace is nicespace
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
x<01>ŽQ
|
||||
Â0DýÎ)re»m’D¼Êîfk#¶)mÄë<1B>þû73¼aFò<§b±…SÙT-k¯± è¡é\Äxt䯮B¤žÚq0+mºÔ¢ÌBô0"(w•¢c$ 8öÈ@†ÞeÊ›}æ}"ÖÍ^uÌ”^ÉóÍÖ=D@×€=ƒ05÷JåüÏ¢ùL©è¾’¨M»]’üŒùÁÞJ|
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a
|
||||
a78b35a896b890f0a2a4f1f924c5739776415250
|
||||
|
||||
7
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/COMMIT_EDITMSG
vendored
Normal file
7
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/COMMIT_EDITMSG
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
whitespace is nicespace
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
# On branch test
|
||||
# Changes to be committed:
|
||||
# modified: README.md
|
||||
#
|
||||
@@ -1 +1 @@
|
||||
ref: refs/heads/master
|
||||
ref: refs/heads/test
|
||||
|
||||
Binary file not shown.
@@ -1 +1,3 @@
|
||||
0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber <joshaber@gmail.com> 1452186187 -0500 clone: from https://github.com/loverajoel/jstips
|
||||
9f0218b7652b622afea799a4723490c43e1af1fe 9f0218b7652b622afea799a4723490c43e1af1fe joshaber <joshaber@gmail.com> 1452201852 -0500 checkout: moving from master to test
|
||||
9f0218b7652b622afea799a4723490c43e1af1fe 0525ef667328cb1f86b1ddf523db4a064e1590fa joshaber <joshaber@gmail.com> 1452201881 -0500 commit: whitespace is nicespace
|
||||
|
||||
2
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/refs/heads/test
vendored
Normal file
2
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/refs/heads/test
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber <joshaber@gmail.com> 1452201852 -0500 branch: Created from HEAD
|
||||
9f0218b7652b622afea799a4723490c43e1af1fe 0525ef667328cb1f86b1ddf523db4a064e1590fa joshaber <joshaber@gmail.com> 1452201881 -0500 commit: whitespace is nicespace
|
||||
@@ -0,0 +1,2 @@
|
||||
x█▌]б └}Ф{
|
||||
,?┘д╞╡пеbliZ▄в≈дТщ╥≥и7≥Iu·KтРт6f╟Qш`╣u8фh2▌ыШ°R═╓╪╢рVlI╛╢Яр d┴йгаY▄▒2с≥╣ 2м┼╡й,Хщ╕╨аЁНEчЮz╗Шc╕Р╨╓:ъ@▀(∙В
|
||||
Binary file not shown.
Binary file not shown.
1
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/refs/heads/test
vendored
Normal file
1
spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/refs/heads/test
vendored
Normal file
@@ -0,0 +1 @@
|
||||
0525ef667328cb1f86b1ddf523db4a064e1590fa
|
||||
@@ -1,5 +1,6 @@
|
||||

|
||||
|
||||
|
||||
# Introducing Javascript Tips
|
||||
> New year, new project. **A JS tip per day!**
|
||||
|
||||
@@ -28,7 +29,7 @@ You just have to concat everything into an array first. `Array.concat` will acce
|
||||
|
||||
```javascript
|
||||
function printUpperCase(words) {
|
||||
var elements = [].concat(words);
|
||||
var elements = [].concat(words);
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
console.log(elements[i].toUpperCase());
|
||||
}
|
||||
@@ -38,7 +39,7 @@ function printUpperCase(words) {
|
||||
`printUpperCase` is now ready to accept a single node or an array of nodes as it's parameter.
|
||||
|
||||
```javascript
|
||||
printUpperCase("cactus");
|
||||
printUpperCase("cactus");
|
||||
// => CACTUS
|
||||
printUpperCase(["cactus", "bear", "potato"]);
|
||||
// => CACTUS
|
||||
|
||||
@@ -552,6 +552,20 @@ describe('GitRepositoryAsync', () => {
|
||||
const head = await repo.getShortHead()
|
||||
expect(head).toBe('master')
|
||||
})
|
||||
|
||||
describe('in a submodule', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copySubmoduleRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
it('returns the human-readable branch name', async () => {
|
||||
await repo.refreshStatus()
|
||||
|
||||
const head = await repo.getShortHead('jstips')
|
||||
expect(head).toBe('test')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getAheadBehindCount(reference, path)', () => {
|
||||
@@ -575,10 +589,26 @@ describe('GitRepositoryAsync', () => {
|
||||
|
||||
it('returns 0, 0 for a branch with no upstream', async () => {
|
||||
await repo.refreshStatus()
|
||||
const {ahead, behind} = repo.getCachedUpstreamAheadBehindCount()
|
||||
|
||||
const {ahead, behind} = await repo.getCachedUpstreamAheadBehindCount()
|
||||
expect(ahead).toBe(0)
|
||||
expect(behind).toBe(0)
|
||||
})
|
||||
|
||||
describe('in a submodule', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copySubmoduleRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
it('returns 0, 0 for a branch with no upstream', async () => {
|
||||
await repo.refreshStatus()
|
||||
|
||||
const {ahead, behind} = await repo.getCachedUpstreamAheadBehindCount('You-Dont-Need-jQuery')
|
||||
expect(ahead).toBe(1)
|
||||
expect(behind).toBe(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getDiffStats(path)', () => {
|
||||
|
||||
Reference in New Issue
Block a user