Merge pull request #5 from electron/all-docs-not-just-api-docs
fetch all docs, not just API docs
This commit is contained in:
Коммит
6ff9454b99
3
index.js
3
index.js
|
@ -35,9 +35,10 @@ function download (version, callback) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('finish', function extracted () {
|
.on('finish', function extracted () {
|
||||||
readFromDisk(path.join(electronDir, 'docs', 'api'), callback)
|
readFromDisk(path.join(electronDir, 'docs'), callback)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(`Downloading ${tarballUrl}`)
|
||||||
got.stream(tarballUrl)
|
got.stream(tarballUrl)
|
||||||
.pipe(gunzip())
|
.pipe(gunzip())
|
||||||
.pipe(extractor)
|
.pipe(extractor)
|
||||||
|
|
|
@ -4,7 +4,7 @@ const semver = require('semver')
|
||||||
const electronDocs = require('..')
|
const electronDocs = require('..')
|
||||||
|
|
||||||
test('electronDocs', {timeout: 30 * 1000}, function (t) {
|
test('electronDocs', {timeout: 30 * 1000}, function (t) {
|
||||||
t.plan(11)
|
t.plan(13)
|
||||||
|
|
||||||
electronDocs('master').then(function (docs) {
|
electronDocs('master').then(function (docs) {
|
||||||
t.comment('fetch by branch name')
|
t.comment('fetch by branch name')
|
||||||
|
@ -12,6 +12,11 @@ test('electronDocs', {timeout: 30 * 1000}, function (t) {
|
||||||
t.ok(docs.every(doc => doc.filename.length > 0), 'every doc has a filename property')
|
t.ok(docs.every(doc => doc.filename.length > 0), 'every doc has a filename property')
|
||||||
t.ok(docs.every(doc => doc.slug.length > 0), 'every doc has a slug property')
|
t.ok(docs.every(doc => doc.slug.length > 0), 'every doc has a slug property')
|
||||||
t.ok(docs.every(doc => doc.markdown_content.length > 0), 'every doc has a markdown_content property')
|
t.ok(docs.every(doc => doc.markdown_content.length > 0), 'every doc has a markdown_content property')
|
||||||
|
|
||||||
|
// console.log(docs.map(doc => doc.filename))
|
||||||
|
t.comment('non-API files are included')
|
||||||
|
t.ok(docs.find(doc => doc.filename === 'styleguide.md'), 'styleguide.md')
|
||||||
|
t.ok(docs.find(doc => doc.filename === 'tutorial/about.md'), 'tutorial/about.md')
|
||||||
})
|
})
|
||||||
|
|
||||||
electronDocs('1.2.0').then(function (docs) {
|
electronDocs('1.2.0').then(function (docs) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче