[Pkg-javascript-commits] [node-detect-indent] 01/01: enable build tests & autopkgtests

Paolo Greppi paolog-guest at moszumanska.debian.org
Fri Dec 2 15:07:00 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-detect-indent.

commit c6e646b6cccb901137f714f86b513a17cec30949
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Fri Dec 2 15:05:32 2016 +0000

    enable build tests & autopkgtests
---
 debian/changelog             |   4 +-
 debian/control               |   1 +
 debian/patches/00_mocha.diff | 135 +++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |   1 +
 debian/rules                 |   6 +-
 debian/tests/control         |   3 +
 6 files changed, 144 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3cf5a5b..bcd2630 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-node-detect-indent (5.0.0-1) UNRELEASED; urgency=low
+node-detect-indent (5.0.0-1) unstable; urgency=low
 
   * Initial release (Closes: #846204)
 
- -- Paolo Greppi <paolo.greppi at libpf.com>  Fri, 02 Dec 2016 14:40:22 +0000
+ -- Paolo Greppi <paolo.greppi at libpf.com>  Fri, 02 Dec 2016 15:04:43 +0000
diff --git a/debian/control b/debian/control
index 940a37d..7aef142 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Paolo Greppi <paolo.greppi at libpf.com>
 Build-Depends:
  debhelper (>= 9)
  , dh-buildinfo
+ , mocha
  , nodejs
 Standards-Version: 3.9.8
 Homepage: https://github.com/sindresorhus/detect-indent#readme
diff --git a/debian/patches/00_mocha.diff b/debian/patches/00_mocha.diff
new file mode 100644
index 0000000..8bb51ed
--- /dev/null
+++ b/debian/patches/00_mocha.diff
@@ -0,0 +1,135 @@
+Description: Change from ava to mocha as test runner (ava is not yet
+ available as a Debian package).
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-detect-indent/test.js
+===================================================================
+--- node-detect-indent.orig/test.js
++++ node-detect-indent/test.js
+@@ -1,95 +1,95 @@
+-import fs from 'fs';
+-import path from 'path';
+-import test from 'ava';
+-import m from './';
++fs = require('fs');
++path = require('path');
++assert = require('assert');
++m = require('./');
+ 
+ function getFile(file) {
+ 	return fs.readFileSync(path.join(__dirname, file), 'utf8');
+ }
+ 
+-test('detect the indent of a file with space indent', t => {
+-	t.is(m(getFile('fixture/space.js')).indent, '    ');
++test('detect the indent of a file with space indent', function() {
++	assert.equal(m(getFile('fixture/space.js')).indent, '    ');
+ });
+ 
+-test('return indentation stats for spaces', t => {
++test('return indentation stats for spaces', function() {
+ 	const stats = m(getFile('fixture/space.js'));
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 4,
+ 		indent: '    ',
+ 		type: 'space'
+ 	});
+ });
+ 
+-test('return indentation stats for multiple tabs', t => {
++test('return indentation stats for multiple tabs', function() {
+ 	const stats = m(getFile('fixture/tab-four.js'));
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 4,
+ 		indent: '\t\t\t\t',
+ 		type: 'tab'
+ 	});
+ });
+ 
+-test('detect the indent of a file with tab indent', t => {
+-	t.is(m(getFile('fixture/tab.js')).indent, '\t');
++test('detect the indent of a file with tab indent', function() {
++	assert.equal(m(getFile('fixture/tab.js')).indent, '\t');
+ });
+ 
+-test('return indentation stats for tabs', t => {
++test('return indentation stats for tabs', function() {
+ 	const stats = m(getFile('fixture/tab.js'));
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 1,
+ 		indent: '\t',
+ 		type: 'tab'
+ 	});
+ });
+ 
+-test('detect the indent of a file with equal tabs and spaces', t => {
+-	t.is(m(getFile('fixture/mixed-tab.js')).indent, '\t');
++test('detect the indent of a file with equal tabs and spaces', function() {
++	assert.equal(m(getFile('fixture/mixed-tab.js')).indent, '\t');
+ });
+ 
+-test('return indentation stats for equal tabs and spaces', t => {
++test('return indentation stats for equal tabs and spaces', function() {
+ 	const indent = m(getFile('fixture/mixed-tab.js'));
+-	t.deepEqual(indent, {
++	assert.deepEqual(indent, {
+ 		amount: 1,
+ 		indent: '\t',
+ 		type: 'tab'
+ 	});
+ });
+ 
+-test('detect the indent of a file with mostly spaces', t => {
++test('detect the indent of a file with mostly spaces', function() {
+ 	const stats = m(getFile('fixture/mixed-space.js'));
+-	t.is(stats.indent, '    ');
++	assert.equal(stats.indent, '    ');
+ });
+ 
+-test('return indentation stats for mostly spaces', t => {
++test('return indentation stats for mostly spaces', function() {
+ 	const stats = m(getFile('fixture/mixed-space.js'));
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 4,
+ 		indent: '    ',
+ 		type: 'space'
+ 	});
+ });
+ 
+-test('detect the indent of a weirdly indented vendor prefixed CSS', t => {
++test('detect the indent of a weirdly indented vendor prefixed CSS', function() {
+ 	const stats = m(getFile('fixture/vendor-prefixed-css.css'));
+-	t.is(stats.indent, '    ');
++	assert.equal(stats.indent, '    ');
+ });
+ 
+-test('return indentation stats for various spaces', t => {
++test('return indentation stats for various spaces', function() {
+ 	const stats = m(getFile('fixture/vendor-prefixed-css.css'));
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 4,
+ 		indent: '    ',
+ 		type: 'space'
+ 	});
+ });
+ 
+-test('return `0` when there is no indentation', t => {
+-	t.is(m('<ul></ul>').amount, 0);
++test('return `0` when there is no indentation', function() {
++	assert.equal(m('<ul></ul>').amount, 0);
+ });
+ 
+-test('return indentation stats for no indentation', t => {
++test('return indentation stats for no indentation', function() {
+ 	const stats = m('<ul></ul>');
+-	t.deepEqual(stats, {
++	assert.deepEqual(stats, {
+ 		amount: 0,
+ 		indent: '',
+ 		type: null
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..09164d3
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00_mocha.diff
diff --git a/debian/rules b/debian/rules
index de57af0..b549f43 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,5 @@
 
 #override_dh_auto_build:
 
-#override_dh_auto_test:
-
-
-
+override_dh_auto_test:
+	mocha -u tdd
diff --git a/debian/tests/control b/debian/tests/control
index 8626d8e..d2a590f 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: require
 Depends: node-detect-indent
+
+Test-Command: mocha -u tdd
+Depends: @, @builddeps@

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



More information about the Pkg-javascript-commits mailing list