From 29efc75672585ff9a94276ca1fd975301082c77b Mon Sep 17 00:00:00 2001 From: Paolo Fragomeni Date: Tue, 31 Jan 2012 06:00:42 -0500 Subject: [PATCH] [test] npm test passes, [doc] updates --- .DS_Store | Bin 0 -> 6148 bytes test/extraction-test.js | 18 ++++-- test/output/write-test-output-0.2.2.js | 22 +++++++- test/output/write-test-output-broad-0.2.2.js | 2 +- .../output/write-test-output-uglifyd-0.2.2.js | 2 +- test/output/write-test-output-wrap-0.2.2.js | 2 +- test/validation-test.js | 18 ++++-- test/write-test.js | 22 ++++++-- write-test-output-0.2.2.js | 52 +----------------- 9 files changed, 69 insertions(+), 69 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ed052ed5e5e23a97e318ff05035cafaefb28c17f GIT binary patch literal 6148 zcmeHKL2uJA6nm}JS zH6BoKAM!j(WP}oTXT>sL8My8Y@V8r|geDZdNGjj&GqgNhDN&Pf5hZB^ZPAoc8g0b? z+=#CuMp8^eI-?KDE6~G`vTB|<;ykEWt<*SM^P+h+HT%ntXqrs2yxsmKc52Rzo3~ug zbL*!klQfp|o-EQhdp#J-`Ct+cqj2^{`FWTZSudQamRDguMvL-~rA*+Tn&^{BoR7~M zyNgA)+im)tPJ7w(7yJ9|rvJG6WV!TQ*K2%p?>%T8JUHG)0$ZRwu4WJ~ z==Ze+btvcMpnM~a7jixBKFw){7lfntE^^>WDo~m#yGLz|*)fVIuJ)-GdA&~zVdbhB zFt4k7=c*sXj&B*T3|u<~cz^JrjDf*YquM%P)D-~epjruh_45z(xdIp%EH$DAB6KQH zrwVh$5a#Y6bUNAt6JKi7=_J(1=*NsK%ne1DtB3GaIEg@`wUzxql`p~yf7LF@5suUP=94m*9;$5f`wE64+1B0bT R)IjWyfTF<~%fLTn;14lCs{{Z5 literal 0 HcmV?d00001 diff --git a/test/extraction-test.js b/test/extraction-test.js index 60585d9..aa87662 100644 --- a/test/extraction-test.js +++ b/test/extraction-test.js @@ -5,12 +5,22 @@ var vm = require('vm'); module.exports = extraction({ - setUp: function (callback) { - callback(); + setUp: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, - tearDown: function (callback) { - callback(); + tearDown: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, '1. Extract a method by `simple` name.': function (test) { diff --git a/test/output/write-test-output-0.2.2.js b/test/output/write-test-output-0.2.2.js index 92aa85c..11ebec1 100644 --- a/test/output/write-test-output-0.2.2.js +++ b/test/output/write-test-output-0.2.2.js @@ -1,10 +1,30 @@ // -// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc // Version 0.2.2 // function test5() { return true; } + + +// +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc +// Version 0.2.2 +// +var test6 = function() { + return String(Date.now()); +}; + + + +// +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc +// Version 0.2.2 +// +var test10 = function() { + return "test10"; +}(); + diff --git a/test/output/write-test-output-broad-0.2.2.js b/test/output/write-test-output-broad-0.2.2.js index 4361321..5485597 100644 --- a/test/output/write-test-output-broad-0.2.2.js +++ b/test/output/write-test-output-broad-0.2.2.js @@ -1,7 +1,7 @@ // -// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc // Version 0.2.2 // diff --git a/test/output/write-test-output-uglifyd-0.2.2.js b/test/output/write-test-output-uglifyd-0.2.2.js index 8ad2da2..bfcd29c 100644 --- a/test/output/write-test-output-uglifyd-0.2.2.js +++ b/test/output/write-test-output-uglifyd-0.2.2.js @@ -1,7 +1,7 @@ // -// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc // Version 0.2.2 // function test5(){return!0} \ No newline at end of file diff --git a/test/output/write-test-output-wrap-0.2.2.js b/test/output/write-test-output-wrap-0.2.2.js index 4b4934c..a7c8255 100644 --- a/test/output/write-test-output-wrap-0.2.2.js +++ b/test/output/write-test-output-wrap-0.2.2.js @@ -1,7 +1,7 @@ // -// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc +// Generated on Tue Jan 31 2012 05:51:43 GMT-0500 (EST) by Nodejitsu Inc // Version 0.2.2 // diff --git a/test/validation-test.js b/test/validation-test.js index 6b93eef..5f0bd7e 100644 --- a/test/validation-test.js +++ b/test/validation-test.js @@ -5,12 +5,22 @@ var fs = require('fs'); module.exports = write({ - setUp: function (callback) { - callback(); + setUp: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, - tearDown: function (callback) { - callback(); + tearDown: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, '1. Lint fail (intentionally).': function (test) { diff --git a/test/write-test.js b/test/write-test.js index 6628bc1..36aa86b 100644 --- a/test/write-test.js +++ b/test/write-test.js @@ -5,12 +5,22 @@ var fs = require('fs'); module.exports = write({ - setUp: function (callback) { - callback(); + setUp: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, - tearDown: function (callback) { - callback(); + tearDown: function (test) { + if (typeof test === 'function') { + test(); + } + else { + test.done(); + } }, '1. Extract a method by `simple` name and write the contents to a new file.': function (test) { @@ -76,7 +86,7 @@ module.exports = write({ }) .read(__dirname + '/fixture1.js') .extract('test6') - .append('write-test-output.js') + .append(__dirname + '/output/write-test-output.js') ; var file = fs.readFileSync(surgeon.newfile, 'utf8'); @@ -102,7 +112,7 @@ module.exports = write({ }) .read(__dirname + '/fixture1.js') .extract('test10') - .append('write-test-output.js', function() { + .append(__dirname + '/output/write-test-output.js', function() { var file = fs.readFileSync(this.newfile, 'utf8'); vm.runInNewContext(file, sandbox, 'sandbox.vm'); diff --git a/write-test-output-0.2.2.js b/write-test-output-0.2.2.js index d22fc7e..867d8eb 100644 --- a/write-test-output-0.2.2.js +++ b/write-test-output-0.2.2.js @@ -1,57 +1,7 @@ // -// Generated on Tue Jan 31 2012 05:35:42 GMT-0500 (EST) by Nodejitsu Inc -// Version 0.2.2 -// -var test6 = function() { - return String(Date.now()); -}; - - - -// -// Generated on Tue Jan 31 2012 05:35:42 GMT-0500 (EST) by Nodejitsu Inc -// Version 0.2.2 -// -var test10 = function() { - return "test10"; -}(); - - - -// -// Generated on Tue Jan 31 2012 05:37:09 GMT-0500 (EST) by Nodejitsu Inc -// Version 0.2.2 -// -var test6 = function() { - return String(Date.now()); -}; - - - -// -// Generated on Tue Jan 31 2012 05:37:09 GMT-0500 (EST) by Nodejitsu Inc -// Version 0.2.2 -// -var test10 = function() { - return "test10"; -}(); - - - -// -// Generated on Tue Jan 31 2012 05:38:29 GMT-0500 (EST) by Nodejitsu Inc -// Version 0.2.2 -// -var test6 = function() { - return String(Date.now()); -}; - - - -// -// Generated on Tue Jan 31 2012 05:38:30 GMT-0500 (EST) by Nodejitsu Inc +// Generated on Tue Jan 31 2012 05:42:15 GMT-0500 (EST) by Nodejitsu Inc // Version 0.2.2 // var test10 = function() {