Permalink
Browse files

[tests] cleanup style

  • Loading branch information...
1 parent 2d1aedf commit 6f058d9187102b243d3b925823be83371ed96d51 Edward Hotchkiss committed Jun 20, 2012
Showing with 60 additions and 51 deletions.
  1. +1 −1 README.md
  2. +15 −12 test/index.test.js
  3. +34 −31 test/popular_modules.test.js
  4. +10 −7 test/self.test.js
View
@@ -1,5 +1,5 @@
-# Version (NodeJS package.json version number fetcher)
+# version (NodeJS package.json version number fetcher)
[![Build Status](https://secure.travis-ci.org/edwardhotchkiss/version.png)](http://travis-ci.org/edwardhotchkiss/version)
View
@@ -1,27 +1,30 @@
-var vows = require("vows");
-var assert = require("assert");
+/**
+ * @tests vows
+ **/
-var version = require("../lib/version");
+var vows = require('vows')
+ , assert = require('assert')
+ , version = require('../lib/version');
-vows.describe("General Module Tests").addBatch({
- "when instantiating version":{
+vows.describe('General Module Tests').addBatch({
+ 'when instantiating version':{
topic:function(){
return version;
},
- "version should be an object and version.fetch and should be a function":function(topic) {
- assert.equal(typeof(version), "object");
- assert.equal(typeof(version.fetch), "function");
+ 'version should be an object and version.fetch and should be a function':function(topic) {
+ assert.equal(typeof(version), 'object');
+ assert.equal(typeof(version.fetch), 'function');
}
},
- "when fetching this packages version without any other formal parameters":{
+ 'when fetching this packages version without any other formal parameters':{
topic:function(){
- version.fetch("version", this.callback);
+ version.fetch('version', this.callback);
},
- "we should receive no error back and receive a version in string format":function(error, version) {
+ 'we should receive no error back and receive a version in string format':function(error, version) {
assert.equal(error, null);
assert.notEqual(version, null);
- assert.equal(typeof(version), "string");
+ assert.equal(typeof(version), 'string');
}
}
}).export(module);
@@ -1,47 +1,50 @@
-var vows = require("vows");
-var assert = require("assert");
+/**
+ * @tests vows
+ **/
-var version = require("../lib/version");
+var vows = require('vows')
+ , assert = require('assert')
+ , version = require('../lib/version');
-/*
- Top 20 (current)
- Most popular NodeJS Modules
-*/
+/**
+ @list Top 20 (current)
+ * @description most popular Node.JS modules
+ **/
var popular = [
- "underscore",
- "coffee-script",
- "request",
- "optimist",
- "connect",
- "colors",
- "async",
- "uglify-js",
- "socket.io",
- "redis",
- "jade",
- "jsdom",
- "mime",
- "vows",
- "commander",
- "mongodb",
- "ejs",
- "node-uuid",
- "stylus",
- "mongoose"
+ 'underscore',
+ 'coffee-script',
+ 'request',
+ 'optimist',
+ 'connect',
+ 'colors',
+ 'async',
+ 'uglify-js',
+ 'socket.io',
+ 'redis',
+ 'jade',
+ 'jsdom',
+ 'mime',
+ 'vows',
+ 'commander',
+ 'mongodb',
+ 'ejs',
+ 'node-uuid',
+ 'stylus',
+ 'mongoose'
];
popular.forEach(function(moduleName) {
- vows.describe("Testing version.fetch() on: " + moduleName).addBatch({
- "When fetching the Version number":{
+ vows.describe('Testing version.fetch() on: ' + moduleName).addBatch({
+ 'When fetching the Version number':{
topic:function(){
version.fetch(moduleName, this.callback);
},
- "we should receive no error back and receive a version in string format":function(error, version) {
+ 'we should receive no error back and receive a version in string format':function(error, version) {
assert.equal(error, null);
assert.notEqual(version, null);
- assert.equal(typeof(version), "string");
+ assert.equal(typeof(version), 'string');
}
}
}).export(module);
View
@@ -1,18 +1,21 @@
-var vows = require("vows");
-var assert = require("assert");
+/**
+ * @tests vows
+ **/
-var version = require("../lib/version");
+var vows = require('vows')
+ , assert = require('assert')
+ , version = require('../lib/version');
-vows.describe("Self package.json Fetching").addBatch({
- "when fetching this packages version with no parameters but a callback":{
+vows.describe('Self package.json Fetching').addBatch({
+ 'when fetching this packages version with no parameters but a callback':{
topic:function(){
version.fetch(this.callback);
},
- "we should receive no error back and receive a version in string format":function(error, version) {
+ 'we should receive no error back and receive a version in string format':function(error, version) {
assert.equal(error, null);
assert.notEqual(version, null);
- assert.equal(typeof(version), "string");
+ assert.equal(typeof(version), 'string');
}
}
}).export(module);

0 comments on commit 6f058d9

Please sign in to comment.