This repository has been archived by the owner on Nov 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
150 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.ghuser.io.json | ||
/.nyc_output/ | ||
/.travis.yml | ||
/coverage/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,55 @@ | ||
import test from 'ava'; | ||
import m from '.'; | ||
|
||
const ora = string => { | ||
if (string) { | ||
console.log(string); | ||
} | ||
return { | ||
start(string) { | ||
if (string) { | ||
console.log(string); | ||
} | ||
return this; | ||
}, | ||
stop() {}, | ||
succeed(string) { | ||
if (string) { | ||
console.log(string); | ||
} | ||
}, | ||
warn() {}, | ||
}; | ||
}; | ||
|
||
test('fetches commits and PRs', async t => { | ||
/* AurelienLourot had the following activity: | ||
* 2017-08-26: nothing | ||
* 2017-08-27: 14 commits in AurelienLourot/mybeir.ut | ||
* 2017-08-28: 1 PR in tt-gf/ant-ivy */ | ||
|
||
const ora = string => { | ||
if (string) { | ||
console.log(string); | ||
} | ||
return { | ||
start(string) { | ||
if (string) { | ||
console.log(string); | ||
} | ||
return this; | ||
}, | ||
stop() {}, | ||
succeed(string) { | ||
if (string) { | ||
console.log(string); | ||
} | ||
}, | ||
warn() {}, | ||
}; | ||
}; | ||
|
||
const result = await m.fetch('AurelienLourot', '2017-08-26', '2017-08-28', ora, console); | ||
t.is(result.size, 2); | ||
t.true(result.has('AurelienLourot/mybeir.ut')); | ||
t.true(result.has('tt-gf/ant-ivy')); | ||
}); | ||
|
||
test('fetches issues', async t => { | ||
/* RichardLitt had the following activity: | ||
* 2018-08-07: 1 issue in orbitdb/welcome */ | ||
|
||
const result = await m.fetch('RichardLitt', '2018-08-07', '2018-08-07', ora, console, true); | ||
t.is(result.size, 1); | ||
t.true(result.has('orbitdb/welcome')); | ||
}); | ||
|
||
test('fetches hot issues', async t => { | ||
/* AurelienLourot had the following activity: | ||
* 2015-09-23: 1 commit in AurelienLourot/AurelienLourot.github.io | ||
1 hot issue in jfrog/build-info */ | ||
|
||
const result = await m.fetch('AurelienLourot', '2015-09-23', '2015-09-23', ora, console, true); | ||
t.is(result.size, 2); | ||
t.true(result.has('AurelienLourot/AurelienLourot.github.io')); | ||
t.true(result.has('jfrog/build-info')); | ||
}); |