Skip to content

Commit 6fbd66d

Browse files
committed
test: add --disabled flag to run disabled tests
1 parent 910eaa5 commit 6fbd66d

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@
6161
},
6262
"scripts": {
6363
"test": "tape test/*.js",
64+
"test-disabled": "npm test -- --disabled",
6465
"test-offline": "npm test -- --offline",
65-
"test-quick": "npm test -- --quick",
66-
"test-offline-quick": "npm test -- --offline --quick"
66+
"test-offline-quick": "npm test -- --offline --quick",
67+
"test-quick": "npm test -- --quick"
6768
}
6869
}

test/clone.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,18 @@ var path = require('path')
1818
var standardPackages = require('standard-packages')
1919
var test = require('tape')
2020

21+
var GIT = 'git'
22+
var STANDARD = path.join(__dirname, '..', 'bin', 'cmd.js')
23+
var TMP = path.join(__dirname, '..', 'tmp')
24+
var PARALLEL_LIMIT = os.cpus().length
25+
2126
var argv = minimist(process.argv.slice(2), {
22-
boolean: [ 'offline', 'quick', 'quiet' ]
27+
boolean: [
28+
'disabled',
29+
'offline',
30+
'quick',
31+
'quiet'
32+
]
2333
})
2434

2535
var testPackages = argv.quick
@@ -32,23 +42,21 @@ testPackages = testPackages.filter(function (pkg) {
3242
return !pkg.disable
3343
})
3444

35-
var GIT = 'git'
36-
var STANDARD = path.join(__dirname, '..', 'bin', 'cmd.js')
37-
var TMP = path.join(__dirname, '..', 'tmp')
38-
39-
var PARALLEL_LIMIT = os.cpus().length
40-
41-
test('Disabled Packages', function (t) {
42-
if (disabledPackages.length === 0) {
43-
t.pass('no disabled packages')
44-
t.end()
45-
} else {
46-
t.plan(disabledPackages.length)
47-
disabledPackages.forEach(function (pkg) {
48-
t.pass('DISABLED: ' + pkg.name + ': ' + pkg.disable + ' (' + pkg.repo + ')')
49-
})
50-
}
51-
})
45+
if (argv.disabled) {
46+
testPackages = disabledPackages
47+
} else {
48+
test('Disabled Packages', function (t) {
49+
if (disabledPackages.length === 0) {
50+
t.pass('no disabled packages')
51+
t.end()
52+
} else {
53+
t.plan(disabledPackages.length)
54+
disabledPackages.forEach(function (pkg) {
55+
t.pass('DISABLED: ' + pkg.name + ': ' + pkg.disable + ' (' + pkg.repo + ')')
56+
})
57+
}
58+
})
59+
}
5260

5361
test('test github repos that use `standard`', function (t) {
5462
t.plan(testPackages.length)

0 commit comments

Comments
 (0)