From 9b3c1a07979b82c53577b2ba3ab76b679d506a60 Mon Sep 17 00:00:00 2001 From: Jesse Tane Date: Tue, 23 Dec 2014 22:44:38 -0500 Subject: [PATCH] do not transform node tests to use tape --- bin/download-node-tests.js | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/bin/download-node-tests.js b/bin/download-node-tests.js index 5ff977a..7723749 100755 --- a/bin/download-node-tests.js +++ b/bin/download-node-tests.js @@ -51,28 +51,13 @@ function testfixer(filename) { if (firstline) { - // require buffer explicitly and wrap in tape test + // require buffer explicitly line = 'var Buffer = require(\'../\').Buffer\n' + - 'var test = require(\'tape\')\n' + - 'if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n' + - 'test(\'' + filename + '\', function(t) {\n' + line + 'if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n' + line firstline = false } - // use tape not assert - if (/^var assert/.test(line)) { - line = line.replace(/(^var assert.*)/, '// $1') - } - else { - - // use "ok" instead of shortcut - line = line.replace(/assert\(/, 'assert.ok(') - - // use tape - line = line.replace(/assert/, 't') - } - // comment out require('common') line = line.replace(/^(var common = require.*)/, '// $1') @@ -85,9 +70,6 @@ function testfixer(filename) { // comment out console logs line = line.replace(/(.*console\..*)/, '// $1') - // tape's equal can't compare strings and buffers - line = line.replace(/t.equal\(buf.slice\(([^\)]*)\), /, 't.equal(buf.slice($1).toString(), ') - // we can't reliably test typed array max-sizes in the browser if (filename === 'test-buffer-big.js') { line = line.replace(/(.*new Int8Array.*RangeError.*)/, '// $1') @@ -110,11 +92,5 @@ function testfixer(filename) { } cb(null, line + '\n') - }, function(cb) { - - // close tape wrapper - this.push('\nt.end()\n})') - - cb() }) } -- 2.34.1