Permalink
Browse files

Working on `docpad render` tests

  • Loading branch information...
balupton committed Jul 19, 2012
1 parent fb9b88b commit de5d01505eb2a7a4b777199fac54809e397c8ea0
View
@@ -68,7 +68,7 @@
"docpad-server": "./bin/docpad-server"
},
"scripts": {
- "test": "node ./out/test/docpad.test.js"
+ "test": "node ./out/test/everything.test.js"
},
"main": "./out/main.js"
}
@@ -76,7 +76,9 @@ class ConsoleInterface
commander
.command('render [path]')
.description("render the file at <path> and output its results to stdout")
- .action(consoleInterface.wrapAction(consoleInterface.render))
+ .action (command) ->
+ commander.debug ?= 5
+ consoleInterface.performAction(command,consoleInterface.render)
# generate
commander
@@ -270,7 +272,6 @@ class ConsoleInterface
render: (next) =>
# Prepare
docpad = @docpad
- docpad.setLogLevel(5) unless docpad.getLogLevel() is 7
commander = @commander
opts = {}
@@ -47,7 +47,7 @@ logger = null
# -------------------------------------
# Tests
-joe.suite 'docpad-core', (suite,test) ->
+joe.suite 'docpad-actions', (suite,test) ->
test 'create', (done) ->
docpad = DocPad.createInstance docpadConfig, (err) ->
@@ -111,7 +111,6 @@ joe.suite 'docpad-core', (suite,test) ->
)
)
-
suite 'server', (suite,test) ->
test 'server action', (done) ->
@@ -0,0 +1,3 @@
+# Tests
+require(__dirname+'/render.test')
+require(__dirname+'/actions.test')
@@ -0,0 +1,41 @@
+# RequirestestServer
+balUtil = require('bal-util')
+chai = require('chai')
+expect = chai.expect
+joe = require('joe')
+_ = require('underscore')
+
+# -------------------------------------
+# Configuration
+
+# Vars
+port = 9780
+docpadPath = __dirname+'/../..'
+rootPath = docpadPath+'/test'
+srcPath = rootPath+'/src'
+outPath = rootPath+'/out'
+outExpectedPath = rootPath+'/out-expected'
+baseUrl = "http://localhost:#{port}"
+testWait = 1000*60*5 # five minutes
+cliPath = docpadPath+'/bin/docpad'
+
+# Configure DocPad
+docpadConfig =
+ growl: false
+ port: port
+ rootPath: rootPath
+ logLevel: if process.env.TRAVIS_NODE_VERSION? then 7 else 5
+ skipUnsupportedPlugins: false
+ catchExceptions: false
+
+
+# -------------------------------------
+# Tests
+
+joe.suite 'docpad-render', (suite,test) ->
+
+ test 'markdown-file', (done) ->
+ command = [cliPath, 'render', 'src/documents/render-single-extensions-false.md']
+ balUtil.spawn command, {cwd:rootPath}, (err,stdout,stderr,code,signal) ->
+ console.log({stdout,err})
+ done(err)

0 comments on commit de5d015

Please sign in to comment.