[Pkg-javascript-commits] [node-dargs] 23/54: Use `ava` for testing

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:03 UTC 2017


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

rouca pushed a commit to branch master
in repository node-dargs.

commit 65f51610d2b29498103d5249c3e3ab463485e573
Author: Kevin Martensson <kevinmartensson at gmail.com>
Date:   Thu Nov 6 08:53:11 2014 +0100

    Use `ava` for testing
---
 package.json |  5 +++--
 test.js      | 23 ++++++++++++++---------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/package.json b/package.json
index 64f79a2..604ab70 100644
--- a/package.json
+++ b/package.json
@@ -22,10 +22,11 @@
     "url": "http://sindresorhus.com"
   },
   "scripts": {
-    "test": "mocha"
+    "test": "node test.js"
   },
   "devDependencies": {
-    "mocha": "*"
+    "array-equal": "^1.0.0",
+    "ava": "^0.0.4"
   },
   "engines": {
     "node": ">=0.10.0"
diff --git a/test.js b/test.js
index 94c3082..a2e231a 100644
--- a/test.js
+++ b/test.js
@@ -1,5 +1,6 @@
 'use strict';
-var assert = require('assert');
+var deepEqual = require('array-equal');
+var test = require('ava');
 var dargs = require('./');
 
 var fixture = {
@@ -15,7 +16,7 @@ var fixture = {
 	camelCaseCamel: true
 };
 
-it('convert options to cli flags', function () {
+test('convert options to cli flags', function (t) {
 	var actual = dargs(fixture);
 	var expected = [
 		'--a=foo',
@@ -28,10 +29,11 @@ it('convert options to cli flags', function () {
 		'--i=let\'s try quotes',
 		'--camel-case-camel'
 	];
-	assert.deepEqual(actual, expected);
+	t.assert(deepEqual(actual, expected));
+	t.end();
 });
 
-it('exclude options', function () {
+test('exclude options', function (t) {
 	var actual = dargs(fixture, ['b', 'e', 'h', 'i']);
 	var expected = [
 		'--a=foo',
@@ -39,10 +41,11 @@ it('exclude options', function () {
 		'--d=5',
 		'--camel-case-camel'
 	];
-	assert.deepEqual(actual, expected);
+	t.assert(deepEqual(actual, expected));
+	t.end();
 });
 
-it('includes options', function () {
+test('includes options', function (t) {
 	var actual = dargs(fixture, [], ['a', 'c', 'd', 'e', 'camelCaseCamel']);
 	var expected = [
 		'--a=foo',
@@ -52,10 +55,11 @@ it('includes options', function () {
 		'--e=bar',
 		'--camel-case-camel'
 	];
-	assert.deepEqual(actual, expected);
+	t.assert(deepEqual(actual, expected));
+	t.end();
 });
 
-it('excludes and includes options', function () {
+test('excludes and includes options', function (t) {
 	var actual = dargs(fixture, ['a', 'd'], ['a', 'c', 'd', 'e', 'camelCaseCamel']);
 	var expected = [
 		'--no-c',
@@ -63,5 +67,6 @@ it('excludes and includes options', function () {
 		'--e=bar',
 		'--camel-case-camel'
 	];
-	assert.deepEqual(actual, expected);
+	t.assert(deepEqual(actual, expected));
+	t.end();
 });

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



More information about the Pkg-javascript-commits mailing list