Skip to content

Commit

Permalink
test: add test packages into same repo
Browse files Browse the repository at this point in the history
Moved from standard-packages. Simpler to keep this updated if it's not in two places
  • Loading branch information
feross committed Oct 29, 2020
1 parent e1b0466 commit 8b97b72
Show file tree
Hide file tree
Showing 3 changed files with 1,592 additions and 12 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -30,7 +30,6 @@
"hallmark": "^3.0.0",
"minimist": "^1.2.5",
"run-parallel-limit": "^1.0.6",
"standard-packages": "^3.10.0",
"tape": "^5.0.1"
},
"engines": {
Expand Down
22 changes: 11 additions & 11 deletions test/clone.js
Expand Up @@ -12,8 +12,8 @@ const minimist = require('minimist')
const os = require('os')
const parallelLimit = require('run-parallel-limit')
const path = require('path')
const standardPackages = require('standard-packages')
const test = require('tape')
const testPkgs = require('./test.json')

const GIT = 'git'
const STANDARD = path.join(__dirname, '..', 'bin', 'cmd.js')
Expand All @@ -30,33 +30,33 @@ const argv = minimist(process.argv.slice(2), {
]
})

let testPackages = argv.quick
? standardPackages.test.slice(0, 20)
: standardPackages.test
let pkgs = argv.quick
? testPkgs.slice(0, 20)
: testPkgs

const disabledPackages = []
testPackages = testPackages.filter(pkg => {
if (pkg.disable) disabledPackages.push(pkg)
const disabledPkgs = []
pkgs = pkgs.filter(pkg => {
if (pkg.disable) disabledPkgs.push(pkg)
return !pkg.disable
})

if (argv.disabled) {
testPackages = disabledPackages
pkgs = disabledPkgs
} else {
test('Disabled Packages', t => {
disabledPackages.forEach(pkg => {
disabledPkgs.forEach(pkg => {
console.log(`DISABLED: ${pkg.name}: ${pkg.disable} (${pkg.repo})`)
})
t.end()
})
}

test('test github repos that use `standard`', t => {
t.plan(testPackages.length)
t.plan(pkgs.length)

fs.mkdirSync(TMP, { recursive: true })

parallelLimit(testPackages.map(pkg => {
parallelLimit(pkgs.map(pkg => {
const name = pkg.name
const url = `${pkg.repo}.git`
const folder = path.join(TMP, name)
Expand Down

0 comments on commit 8b97b72

Please sign in to comment.