[Pkg-javascript-commits] [node-invariant] 02/02: Disable browserify & flow tests, use node-tap for testing

Paolo Greppi paolog-guest at moszumanska.debian.org
Mon Dec 12 07:36:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

paolog-guest pushed a commit to branch master
in repository node-invariant.

commit 39dd99dacf86b8979da2985feb84b8d8a14839c0
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Mon Dec 12 07:36:05 2016 +0000

    Disable browserify & flow tests, use node-tap for testing
---
 debian/control                       |   2 +-
 debian/patches/00-cleanup_tests.diff |  48 +++++++++++++++
 debian/patches/00_mocha.diff         | 113 -----------------------------------
 debian/patches/series                |   2 +-
 debian/rules                         |   2 +-
 debian/tests/control                 |   2 +-
 6 files changed, 52 insertions(+), 117 deletions(-)

diff --git a/debian/control b/debian/control
index 827159f..9b678b5 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends:
  debhelper (>= 9)
  , dh-buildinfo
  , node-loose-envify
- , mocha
+ , node-tap
  , nodejs
 Standards-Version: 3.9.8
 Homepage: https://github.com/zertosh/invariant#readme
diff --git a/debian/patches/00-cleanup_tests.diff b/debian/patches/00-cleanup_tests.diff
new file mode 100644
index 0000000..81f4152
--- /dev/null
+++ b/debian/patches/00-cleanup_tests.diff
@@ -0,0 +1,48 @@
+Description: Disable browserify & flow tests.
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-invariant/test/test.js
+===================================================================
+--- node-invariant.orig/test/test.js
++++ node-invariant/test/test.js
+@@ -1,9 +1,7 @@
+ 'use strict';
+ 
+-var browserify = require('browserify');
+ var test = require('tap').test;
+ var vm = require('vm');
+-var flow = require('flow-bin');
+ var execFile = require('child_process').execFile;
+ var path = require('path');
+ 
+@@ -13,29 +11,3 @@ test('node', function(t) {
+   t.plan(4);
+   require(file)(t);
+ });
+-
+-test('browserify', function(t) {
+-  t.plan(7);
+-  var b = browserify({
+-    entries: file,
+-    standalone: 'package'
+-  });
+-  b.bundle(function(err, src) {
+-    t.notOk(err);
+-    t.notMatch(String(src), /\bprocess\.env\.NODE_ENV\b/);
+-    t.notMatch(String(src), /__DEV__/);
+-    var c = {};
+-    vm.runInNewContext(src, c);
+-    c.package(t);
+-  });
+-});
+-
+-test('flow', function(t) {
+-  t.plan(1);
+-  execFile(flow, ['coverage', 'index.js'], {
+-    cwd: path.join(__dirname, 'flow')
+-  }, function (err, stdout) {
+-    // If the types are broken, we'd have coverage below 100%
+-    t.equal(stdout.trim(), 'Covered: 100.00% (5 of 5 expressions)');
+-  });
+-});
diff --git a/debian/patches/00_mocha.diff b/debian/patches/00_mocha.diff
deleted file mode 100644
index c6b912c..0000000
--- a/debian/patches/00_mocha.diff
+++ /dev/null
@@ -1,113 +0,0 @@
-Description: Change from tap to mocha as test runner, disable 
- browserify & flow tests. 
-Forwarded: not-needed
-Author: Paolo Greppi <paolo.greppi at libpf.com>
-
-Index: node-invariant/test/package/development.js
-===================================================================
---- node-invariant.orig/test/package/development.js
-+++ node-invariant/test/package/development.js
-@@ -1,19 +1,21 @@
--module.exports = function(t) {
-+var assert = require('assert');
-+
-+module.exports = function() {
-   var invariant = require('../../');
- 
--  t.doesNotThrow(function() {
-+  assert.doesNotThrow(function() {
-     invariant(true, 'invariant message');
-   });
- 
--  t.throws(function() {
-+  assert.throws(function() {
-     invariant(false, 'invariant message');
-   }, /invariant message/);
- 
--  t.throws(function() {
-+  assert.throws(function() {
-     invariant(true);
-   }, /requires an error/i);
- 
--  t.throws(function() {
-+  assert.throws(function() {
-     invariant(false);
-   }, /requires an error/i);
- };
-Index: node-invariant/test/package/production.js
-===================================================================
---- node-invariant.orig/test/package/production.js
-+++ node-invariant/test/package/production.js
-@@ -1,19 +1,21 @@
-+var assert = require('assert');
-+	
- module.exports = function(t) {
-   var invariant = require('../../');
- 
--  t.doesNotThrow(function() {
-+  assert.doesNotThrow(function() {
-     invariant(true, 'invariant message');
-   });
- 
--  t.throws(function() {
-+  assert.throws(function() {
-     invariant(false, 'invariant message');
-   }, /invariant message/);
- 
--  t.doesNotThrow(function() {
-+  assert.doesNotThrow(function() {
-     invariant(true);
-   });
- 
--  t.throws(function() {
-+  assert.throws(function() {
-     invariant(false);
-   }, /minified exception occurred/i);
- };
-Index: node-invariant/test/test.js
-===================================================================
---- node-invariant.orig/test/test.js
-+++ node-invariant/test/test.js
-@@ -1,7 +1,5 @@
- 'use strict';
- 
--var browserify = require('browserify');
--var test = require('tap').test;
- var vm = require('vm');
- var flow = require('flow-bin');
- var execFile = require('child_process').execFile;
-@@ -9,33 +7,6 @@ var path = require('path');
- 
- var file = __dirname + '/package/' + process.env.NODE_ENV + '.js';
- 
--test('node', function(t) {
--  t.plan(4);
-+test('node', function() {
-   require(file)(t);
- });
--
--test('browserify', function(t) {
--  t.plan(7);
--  var b = browserify({
--    entries: file,
--    standalone: 'package'
--  });
--  b.bundle(function(err, src) {
--    t.notOk(err);
--    t.notMatch(String(src), /\bprocess\.env\.NODE_ENV\b/);
--    t.notMatch(String(src), /__DEV__/);
--    var c = {};
--    vm.runInNewContext(src, c);
--    c.package(t);
--  });
--});
--
--test('flow', function(t) {
--  t.plan(1);
--  execFile(flow, ['coverage', 'index.js'], {
--    cwd: path.join(__dirname, 'flow')
--  }, function (err, stdout) {
--    // If the types are broken, we'd have coverage below 100%
--    t.equal(stdout.trim(), 'Covered: 100.00% (5 of 5 expressions)');
--  });
--});
diff --git a/debian/patches/series b/debian/patches/series
index 09164d3..de71ec9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-00_mocha.diff
+00-cleanup_tests.diff
diff --git a/debian/rules b/debian/rules
index b549f43..b77d34d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,4 +10,4 @@
 #override_dh_auto_build:
 
 override_dh_auto_test:
-	mocha -u tdd
+	NODE_ENV=production tap test/*.js && NODE_ENV=development tap test/*.js
diff --git a/debian/tests/control b/debian/tests/control
index 56e2f21..6009c2b 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,5 +1,5 @@
 Tests: require
 Depends: node-invariant
 
-Test-Command: mocha -u tdd
+Test-Command: NODE_ENV=production tap test/*.js && NODE_ENV=development tap test/*.js
 Depends: @, @builddeps@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-invariant.git



More information about the Pkg-javascript-commits mailing list