More tests for the submodule cases.

This commit is contained in:
joshaber
2016-01-07 16:37:05 -05:00
parent 565f28dfc4
commit d2d5966ee1
20 changed files with 64 additions and 5 deletions

View File

@@ -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)

View 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
#

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,2 @@
x<01>ŽQ
Â0DýÎ)re»mD¼Êî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|

View File

@@ -1 +1 @@
2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a
a78b35a896b890f0a2a4f1f924c5739776415250

View 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
#

View File

@@ -1 +1 @@
ref: refs/heads/master
ref: refs/heads/test

View File

@@ -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

View 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

View File

@@ -0,0 +1,2 @@
x█▌]б └}Ф{
,?┘д╞╡пеbliZ▄в≈дТщ╥≥и7≥Iu·KтРт6f╟Qш`╣u8фh2▌ыШ°R═╓╪╢рVlI╛╢Яр d┴йгаY▄▒2с╣ 2м┼╡й,Хщ╕╨аЁНEчЮz╗Шc╕Р╨╓:ъ@▀(∙В

View File

@@ -0,0 +1 @@
0525ef667328cb1f86b1ddf523db4a064e1590fa

View File

@@ -1,5 +1,6 @@
![header](https://raw.githubusercontent.com/loverajoel/jstips/master/resources/jstips-header-blog.gif)
# 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

View File

@@ -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)', () => {