Skip to content
Browse files

Switch unit tests to utest

  • Loading branch information...
1 parent 53d427e commit 99a00163e9837e7914f8e35767cbbb23850c483a @felixge felixge committed Nov 26, 2011
Showing with 30 additions and 27 deletions.
  1. +2 −1 package.json
  2. +22 −22 test/unit/test-client.js
  3. +6 −4 test/unit/test-mysql.js
View
3 package.json
@@ -18,7 +18,8 @@
"devDependencies": {
"gently": "0.8.0",
"fast-or-slow": "0.0.5",
- "urun": "0.0.4"
+ "urun": "0.0.4",
+ "utest": "0.0.3"
},
"engines": {
"node": "*"
View
44 test/unit/test-client.js
@@ -1,33 +1,33 @@
var common = require('../common');
var assert = require('assert');
-var test = common.fastOrSlow.fast();
+var test = require('utest');
var Client = require(common.dir.lib + '/client');
var client;
-test.before(function() {
- client = new Client();
-});
-
-test('#format() does not manipulate params parameter', function() {
- var sql = '?';
- var params = [1];
+test('Client', {
+ before: function() {
+ client = new Client();
+ },
- client.format(sql, params);
- assert.equal(params.length, 1);
-});
+ '#format() does not manipulate params parameter': function() {
+ var sql = '?';
+ var params = [1];
-test('#format() does not quote floats', function() {
- var params = [1.23];
+ client.format(sql, params);
+ assert.equal(params.length, 1);
+ },
- var sql = client.format('?', params);
- assert.strictEqual(sql, '1.23');
-});
+ '#format() does not quote floats': function() {
+ var params = [1.23];
-// https://github.com/felixge/node-mysql/issues/96
-test('Timeout reconnect works with empty queue', function() {
- // A non-error packet
- var packet = {};
+ var sql = client.format('?', params);
+ assert.strictEqual(sql, '1.23');
+ },
- // This must not throw an error
- client._handlePacket(packet);
+ 'Timeout reconnect works with empty queue': function() {
+ // A non-error packet
+ var packet = {};
+ // This must not throw an error
+ client._handlePacket(packet);
+ },
});
View
10 test/unit/test-mysql.js
@@ -1,8 +1,10 @@
var common = require('../common');
var assert = require('assert');
-var test = common.fastOrSlow.fast();
-var mysql = require(common.dir.lib + '/mysql');
+var test = require('utest');
+var mysql = require(common.dir.lib + '/mysql');
-test('Package JSON is exported', function() {
- assert.strictEqual(mysql.PACKAGE.name, 'mysql');
+test('mysql module', {
+ 'Package JSON is exported': function() {
+ assert.strictEqual(mysql.PACKAGE.name, 'mysql');
+ },
});

0 comments on commit 99a0016

Please sign in to comment.
Something went wrong with that request. Please try again.