Permalink
Browse files

fix(task): resolve paths in demo and in actual use

Correct path handling for test runner so that it resolves paths properly even when run in the task demo.
  • Loading branch information...
1 parent 7caed05 commit 28e37ac93befc3836448f66525b7b35645f6f464 @laurelnaiad committed Nov 17, 2013
Showing with 14 additions and 4 deletions.
  1. +1 −1 Gruntfile.coffee
  2. +1 −1 package.json
  3. +12 −2 tasks/blanket_mocha_server.coffee
View
@@ -89,8 +89,8 @@ module.exports = (grunt) ->
informative: false
order:
'introduction.md': 'Introduction'
- 'getting-started.md': 'Getting Started'
'overview.md': 'Overview'
+ 'getting-started.md': 'Getting Started'
'options.md': 'Options'
'../../CONTRIBUTING.md': 'Contributing'
'faq.md': 'FAQ'
View
@@ -60,7 +60,7 @@
},
"peerDependencies": {
"grunt": "~0.4.0",
- "grunt-blanket-mocha": "~0.3.0"
+ "grunt-blanket-mocha": "*"
},
"dependencies": {
"grunt-contrib-connect": "~0.5.0"
@@ -52,7 +52,17 @@ module.exports = (grunt) ->
resolveFile = (obj, prop) ->
obj[prop] = path.resolve obj[prop]
minViolationTest obj, prop
- obj[prop] = obj[prop].replace(path.resolve(process.cwd()), '')
+ inAppPath = process.cwd() + '/node_modules/grunt-blanket-mocha-server'
+ if !(fs.existsSync(inAppPath))
+ obj[prop] = obj[prop].replace(
+ path.resolve(__dirname + '/..'),
+ ''
+ )
+ else
+ obj[prop] = obj[prop].replace(
+ path.resolve(__dirname + '/..'),
+ '/node_modules/grunt-blanket-mocha-server'
+ )
undefined
###*
@@ -141,7 +151,7 @@ module.exports = (grunt) ->
gbmsLib = __dirname + '/../lib/'
gbmsSupport = __dirname + '/support/'
- gbmSupport = process.cwd() + '/node_modules/grunt-blanket-mocha/support/'
+ gbmSupport = __dirname + '/../node_modules/grunt-blanket-mocha/support/'
defaultOptions =
server: true

0 comments on commit 28e37ac

Please sign in to comment.