Skip to content

Commit

Permalink
test: add script to detect non-existent repos
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Oct 29, 2020
1 parent 0d429d0 commit 6f9f2f1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -30,6 +30,8 @@
"hallmark": "^3.0.0",
"minimist": "^1.2.5",
"run-parallel-limit": "^1.0.6",
"run-series": "^1.1.9",
"simple-get": "^4.0.0",
"tape": "^5.0.1"
},
"engines": {
Expand Down
26 changes: 26 additions & 0 deletions tools/test-exists.js
@@ -0,0 +1,26 @@
/**
* Sanity check that all repos in test.json actually exist on GitHub
*/

const get = require('simple-get')
const testPkgs = require('../test/test.json')
const series = require('run-series')

series(testPkgs.map(function (pkg) {
return function (cb) {
console.log('checking ' + pkg.repo + '...')
get.head(pkg.repo, function (err, res) {
if (res.statusCode !== 200) {
err = new Error('Non-200 status code ' + res.statusCode)
}
if (err) {
err.message = pkg.name + ': ' + err.message
cb(err)
} else {
cb(null)
}
})
}
}), function (err) {
if (err) throw err
})

0 comments on commit 6f9f2f1

Please sign in to comment.