Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 28e37ac93befc3836448f66525b7b35645f6f464 1 parent 7caed05
@laurelnaiad authored
View
2  Gruntfile.coffee
@@ -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
2  package.json
@@ -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"
View
14 tasks/blanket_mocha_server.coffee
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.