Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace tape with tap #1171

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"node": ">= 0.8.0"
},
"devDependencies": {
"tape": "~4.2.0",
"bindings": "~1.2.1",
"nan": "^2.0.0",
"require-inject": "~1.3.0"
"require-inject": "~1.3.0",
"tap": "^10.3.2"
},
"scripts": {
"test": "tape test/test-*"
"test": "tap test/test-*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO need to add -Rtap

}
}
4 changes: 2 additions & 2 deletions test/test-addon.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict'

var test = require('tape')
var tap = require('tap')
var execFile = require('child_process').execFile
var path = require('path')
var addonPath = path.resolve(__dirname, 'node_modules', 'hello_world')
var nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js')

test('build simple addon', function (t) {
tap.test('build simple addon', function (t) {
t.plan(3)

// Set the loglevel otherwise the output disappears when run via 'npm test'
Expand Down
8 changes: 4 additions & 4 deletions test/test-configure-python.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

var test = require('tape')
var tap = require('tap')
var path = require('path')
var gyp = require('../lib/node-gyp')
var requireInject = require('require-inject')
Expand All @@ -15,7 +15,7 @@ var EXPECTED_PYPATH = path.join(__dirname, '..', 'gyp', 'pylib')
var SEPARATOR = process.platform == 'win32' ? ';' : ':'
var SPAWN_RESULT = { on: function () { } }

test('configure PYTHONPATH with no existing env', function (t) {
tap.test('configure PYTHONPATH with no existing env', function (t) {
t.plan(1)

delete process.env.PYTHONPATH
Expand All @@ -29,7 +29,7 @@ test('configure PYTHONPATH with no existing env', function (t) {
configure(prog, [])
})

test('configure PYTHONPATH with existing env of one dir', function (t) {
tap.test('configure PYTHONPATH with existing env of one dir', function (t) {
t.plan(2)

var existingPath = path.join('a', 'b')
Expand All @@ -49,7 +49,7 @@ test('configure PYTHONPATH with existing env of one dir', function (t) {
configure(prog, [])
})

test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
tap.test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
t.plan(2)

var pythonDir1 = path.join('a', 'b')
Expand Down
10 changes: 5 additions & 5 deletions test/test-download.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
var fs = require('fs')
var http = require('http')
var https = require('https')
var test = require('tape')
var tap = require('tap')
var install = require('../lib/install')

test('download over http', function (t) {
tap.test('download over http', function (t) {
t.plan(2)

var server = http.createServer(function (req, res) {
Expand Down Expand Up @@ -38,7 +38,7 @@ test('download over http', function (t) {
})
})

test('download over https with custom ca', function (t) {
tap.test('download over https with custom ca', function (t) {
t.plan(3)

var cert = fs.readFileSync(__dirname + '/fixtures/server.crt', 'utf8')
Expand Down Expand Up @@ -82,7 +82,7 @@ test('download over https with custom ca', function (t) {
})
})

test('download with missing cafile', function (t) {
tap.test('download with missing cafile', function (t) {
t.plan(1)
var gyp = {
opts: { cafile: 'no.such.file' },
Expand All @@ -94,7 +94,7 @@ test('download with missing cafile', function (t) {
}
})

test('check certificate splitting', function (t) {
tap.test('check certificate splitting', function (t) {
var cas = install.test.readCAFile(__dirname + '/fixtures/ca-bundle.crt')
t.plan(2)
t.strictEqual(cas.length, 2)
Expand Down
16 changes: 8 additions & 8 deletions test/test-find-accessible-sync.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

var test = require('tape')
var tap = require('tap')
var path = require('path')
var requireInject = require('require-inject')
var configure = requireInject('../lib/configure', {
Expand All @@ -27,31 +27,31 @@ var readableFiles = [
path.resolve(dir, readableFileInDir)
]

test('find accessible - empty array', function (t) {
tap.test('find accessible - empty array', function (t) {
t.plan(1)

var candidates = []
var found = configure.test.findAccessibleSync('test', dir, candidates)
t.strictEqual(found, undefined)
})

test('find accessible - single item array, readable', function (t) {
tap.test('find accessible - single item array, readable', function (t) {
t.plan(1)

var candidates = [ readableFile ]
var found = configure.test.findAccessibleSync('test', dir, candidates)
t.strictEqual(found, path.resolve(dir, readableFile))
})

test('find accessible - single item array, readable in subdir', function (t) {
tap.test('find accessible - single item array, readable in subdir', function (t) {
t.plan(1)

var candidates = [ readableFileInDir ]
var found = configure.test.findAccessibleSync('test', dir, candidates)
t.strictEqual(found, path.resolve(dir, readableFileInDir))
})

test('find accessible - single item array, unreadable', function (t) {
tap.test('find accessible - single item array, unreadable', function (t) {
t.plan(1)

var candidates = [ 'unreadable_file' ]
Expand All @@ -60,7 +60,7 @@ test('find accessible - single item array, unreadable', function (t) {
})


test('find accessible - multi item array, no matches', function (t) {
tap.test('find accessible - multi item array, no matches', function (t) {
t.plan(1)

var candidates = [ 'non_existent_file', 'unreadable_file' ]
Expand All @@ -69,15 +69,15 @@ test('find accessible - multi item array, no matches', function (t) {
})


test('find accessible - multi item array, single match', function (t) {
tap.test('find accessible - multi item array, single match', function (t) {
t.plan(1)

var candidates = [ 'non_existent_file', readableFile ]
var found = configure.test.findAccessibleSync('test', dir, candidates)
t.strictEqual(found, path.resolve(dir, readableFile))
})

test('find accessible - multi item array, return first match', function (t) {
tap.test('find accessible - multi item array, return first match', function (t) {
t.plan(1)

var candidates = [ 'non_existent_file', anotherReadableFile, readableFile ]
Expand Down
16 changes: 8 additions & 8 deletions test/test-find-node-directory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var test = require('tape')
var tap = require('tap')
var path = require('path')
var findNodeDirectory = require('../lib/find-node-directory')

Expand All @@ -8,7 +8,7 @@ var platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix']
// the script is running in and it should match the layout
// in a build tree where npm is installed in
// .... /deps/npm
test('test find-node-directory - node install', function (t) {
tap.test('test find-node-directory - node install', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
Expand All @@ -23,7 +23,7 @@ test('test find-node-directory - node install', function (t) {
// in an installed tree where npm is installed in
// .... /lib/node_modules/npm or .../node_modules/npm
// depending on the patform
test('test find-node-directory - node build', function (t) {
tap.test('test find-node-directory - node build', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
Expand All @@ -41,7 +41,7 @@ test('test find-node-directory - node build', function (t) {

// we should find the directory based on the execPath
// for node and match because it was in the bin directory
test('test find-node-directory - node in bin directory', function (t) {
tap.test('test find-node-directory - node in bin directory', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
Expand All @@ -53,7 +53,7 @@ test('test find-node-directory - node in bin directory', function (t) {

// we should find the directory based on the execPath
// for node and match because it was in the Release directory
test('test find-node-directory - node in build release dir', function (t) {
tap.test('test find-node-directory - node in build release dir', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj
Expand All @@ -72,7 +72,7 @@ test('test find-node-directory - node in build release dir', function (t) {

// we should find the directory based on the execPath
// for node and match because it was in the Debug directory
test('test find-node-directory - node in Debug release dir', function (t) {
tap.test('test find-node-directory - node in Debug release dir', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj
Expand All @@ -90,7 +90,7 @@ test('test find-node-directory - node in Debug release dir', function (t) {

// we should not find it as it will not match based on the execPath nor
// the directory from which the script is running
test('test find-node-directory - not found', function (t) {
tap.test('test find-node-directory - not found', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj = {execPath: '/x/y/z/y', platform:next}
Expand All @@ -104,7 +104,7 @@ test('test find-node-directory - not found', function (t) {
// .... /deps/npm
// same test as above but make sure additional directory entries
// don't cause an issue
test('test find-node-directory - node install', function (t) {
tap.test('test find-node-directory - node install', function (t) {
t.plan(platforms.length)
for (var next = 0; next < platforms.length; next++) {
var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
Expand Down
26 changes: 13 additions & 13 deletions test/test-find-python.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict'

var test = require('tape')
var tap = require('tap')
var configure = require('../lib/configure')
var execFile = require('child_process').execFile
var PythonFinder = configure.test.PythonFinder

test('find python', function (t) {
tap.test('find python', function (t) {
t.plan(4)

configure.test.findPython('python', function (err, found) {
Expand Down Expand Up @@ -42,7 +42,7 @@ poison(TestPythonFinder.prototype, 'stat')
poison(TestPythonFinder.prototype, 'which')
poison(TestPythonFinder.prototype, 'win')

test('find python - python', function (t) {
tap.test('find python - python', function (t) {
t.plan(5)

var f = new TestPythonFinder('python', done)
Expand All @@ -63,7 +63,7 @@ test('find python - python', function (t) {
}
})

test('find python - python too old', function (t) {
tap.test('find python - python too old', function (t) {
t.plan(4)

var f = new TestPythonFinder('python', done)
Expand All @@ -83,7 +83,7 @@ test('find python - python too old', function (t) {
}
})

test('find python - python too new', function (t) {
tap.test('find python - python too new', function (t) {
t.plan(4)

var f = new TestPythonFinder('python', done)
Expand All @@ -103,7 +103,7 @@ test('find python - python too new', function (t) {
}
})

test('find python - no python', function (t) {
tap.test('find python - no python', function (t) {
t.plan(2)

var f = new TestPythonFinder('python', done)
Expand All @@ -118,7 +118,7 @@ test('find python - no python', function (t) {
}
})

test('find python - no python2', function (t) {
tap.test('find python - no python2', function (t) {
t.plan(6)

var f = new TestPythonFinder('python2', done)
Expand All @@ -143,7 +143,7 @@ test('find python - no python2', function (t) {
}
})

test('find python - no python2, no python, unix', function (t) {
tap.test('find python - no python2, no python, unix', function (t) {
t.plan(3)

var f = new TestPythonFinder('python2', done)
Expand All @@ -165,7 +165,7 @@ test('find python - no python2, no python, unix', function (t) {
}
})

test('find python - no python, use python launcher', function (t) {
tap.test('find python - no python, use python launcher', function (t) {
t.plan(8)

var f = new TestPythonFinder('python', done)
Expand Down Expand Up @@ -195,7 +195,7 @@ test('find python - no python, use python launcher', function (t) {
}
})

test('find python - python 3, use python launcher', function (t) {
tap.test('find python - python 3, use python launcher', function (t) {
t.plan(10)

var f = new TestPythonFinder('python', done)
Expand Down Expand Up @@ -230,7 +230,7 @@ test('find python - python 3, use python launcher', function (t) {
}
})

test('find python - python 3, use python launcher, python 2 too old',
tap.test('find python - python 3, use python launcher, python 2 too old',
function (t) {
t.plan(9)

Expand Down Expand Up @@ -266,7 +266,7 @@ test('find python - python 3, use python launcher, python 2 too old',
}
})

test('find python - no python, no python launcher, good guess', function (t) {
tap.test('find python - no python, no python launcher, good guess', function (t) {
t.plan(6)

var re = /C:[\\\/]Python27[\\\/]python[.]exe/
Expand Down Expand Up @@ -298,7 +298,7 @@ test('find python - no python, no python launcher, good guess', function (t) {
}
})

test('find python - no python, no python launcher, bad guess', function (t) {
tap.test('find python - no python, no python launcher, bad guess', function (t) {
t.plan(4)

var f = new TestPythonFinder('python', done)
Expand Down
4 changes: 2 additions & 2 deletions test/test-options.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

var test = require('tape')
var tap = require('tap')
var gyp = require('../lib/node-gyp')

test('options in environment', function (t) {
tap.test('options in environment', function (t) {
t.plan(1)

// `npm test` dumps a ton of npm_config_* variables in the environment.
Expand Down
Loading