Permalink
Browse files

Better unit test

  • Loading branch information...
1 parent 3917010 commit f955e35eaa46244f8af32aa108099adf2f5721e0 @serby committed Apr 3, 2013
Showing with 19 additions and 17 deletions.
  1. +2 −2 bundled.js
  2. +1 −1 package.json
  3. +3 −1 test/bundled.js
  4. +13 −13 test/fixtures/doodad/bundle.js
View
@@ -233,8 +233,8 @@ module.exports = function(app, options) {
})
function getParamNames(func) {
- var funStr = func.toString();
- return funStr.slice(funStr.indexOf('(')+1, funStr.indexOf(')')).match(/([^\s,]+)/g);
+ var funStr = func.toString()
+ return funStr.slice(funStr.indexOf('(')+1, funStr.indexOf(')')).match(/([^\s,]+)/g)
}
View
@@ -2,7 +2,7 @@
"author": "Paul Serby <paul@serby.net>",
"name": "bundled",
"description": "A standalone bundle manager which can add an plugin system to any application",
- "version": "0.0.5",
+ "version": "0.0.6",
"repository": {
"type": "git",
"url": "git@github.com:serby/bundled"
View
@@ -109,9 +109,11 @@ describe('bundled', function() {
, notAsync = require('..')(app, { logger: logger, strictDependencyChecking: true })
.addPath(__dirname + '/fixtures/not-async')
.addPath(__dirname + '/fixtures/doodad')
+ .addPath(__dirname + '/fixtures/hoozit')
+ .addPath(__dirname + '/fixtures/woozit')
notAsync.initialize(function () {
- app.order.should.eql([ 'not async', 'doodad 1', 'doodad 2'])
+ app.order.should.eql(['not async', 'doodad 1', 'hoozit', 'woozit 1', 'doodad 2', 'woozit 2'])
done()
})
@@ -3,18 +3,18 @@ module.exports = {
version: '0.0.1',
description: 'A very cool doodad',
nav: 'doodad',
- initialize: [
- function(app, done) {
- process.nextTick(function () {
- app.order.push('doodad 1')
- done()
- })
- },
- function(app, done) {
- setTimeout(function () {
- app.order.push('doodad 2')
- done()
- }, 50)
- }
+ initialize:
+ [ function(app, done) {
+ setTimeout(function () {
+ app.order.push('doodad 1')
+ done()
+ }, 50)
+ }
+ , function(app, done) {
+ process.nextTick(function () {
+ app.order.push('doodad 2')
+ done()
+ })
+ }
]
};

0 comments on commit f955e35

Please sign in to comment.