Skip to content

Commit

Permalink
Merge pull request #147 from abartomeu/v0.4.0-beta.9
Browse files Browse the repository at this point in the history
Fixed linting errors, test failures, missing dependency and segfault caused by jit-grunt
  • Loading branch information
plroebuck committed Jun 8, 2016
2 parents bd5a2ab + 491d018 commit b525c08
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
7 changes: 4 additions & 3 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = (grunt) ->
require('time-grunt') grunt

# Dynamically load npm tasks
require('jit-grunt') grunt
require('load-grunt-config') grunt

grunt.initConfig

Expand All @@ -12,10 +12,11 @@ module.exports = (grunt) ->
all:
files: [
"Gruntfile.coffee"
"src/**/*.coffee"
"lib/**/*.coffee"
"test/**/*.coffee"
]
tasks: [
"coffeecov"
"mochaTest"
]
options:
Expand All @@ -25,7 +26,7 @@ module.exports = (grunt) ->
default:
src: [
'Gruntfile.coffee'
'src/**/*.coffee'
'lib/**/*.coffee'
'test/**/*.coffee'
]
options: {
Expand Down
3 changes: 2 additions & 1 deletion lib/add-tests.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ addTests = (raml, tests, hooks, parent, callback, testFactory) ->
# expect content-type of response body to be identical to request body
if contentType && res.body[contentType]?.schema
test.response.schema = parseSchema res.body[contentType].schema
# otherwise filter in responses section for compatible content-types (vendor tree, i.e. application/vnd.api+json)
# otherwise filter in responses section for compatible content-types
# (vendor tree, i.e. application/vnd.api+json)
else
contentType = (type for type of res.body when type.match(/^application\/(.*\+)?json/i))?[0]
if res.body[contentType]?.schema
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Hooks
afterEach: (hook) =>
@afterEachHooks.push(hook)

addHook: (hooks, name, hook) =>
addHook: (hooks, name, hook) ->
if hooks[name]
hooks[name].push hook
else
Expand Down
3 changes: 2 additions & 1 deletion lib/options.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ options =

header:
alias: 'h'
description: 'Add header to include in each request. Header must be in KEY:VALUE format (e.g., "-h Accept:application/json").\nReuse option to add multiple headers'
description: 'Add header to include in each request. Header must be in KEY:VALUE format ' +
'(e.g., "-h Accept:application/json").\nReuse option to add multiple headers'
type: 'string'

'hooks-only':
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
"grunt-cli": "~1.2.0",
"grunt-coffeecov": "^0.1.5",
"grunt-coffeelint": "^0.0.16",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "~0.12.7",
"grunt-shell": "^1.2.1",
"jit-grunt": "~0.10.0",
"load-grunt-config": "^0.19.2",
"mocha-phantom-coverage-reporter": "^0.1.0",
"mute": "^1.0.0",
"nock": "^8.0.0",
Expand Down
20 changes: 10 additions & 10 deletions test/unit/test-runner-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe 'Test Runner', ->
options =
server: "#{ABAO_IO_SERVER}"

runner = new TestRunner options
runner = new TestRunner options , ''

runCallback = sinon.stub()
runCallback(done)
Expand Down Expand Up @@ -168,7 +168,7 @@ describe 'Test Runner', ->
options =
server: "#{ABAO_IO_SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub test, 'run', (callback) ->
callback()

Expand Down Expand Up @@ -196,7 +196,7 @@ describe 'Test Runner', ->
options =
server: "#{SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub runner.mocha, 'run', (callback) -> callback()
sinon.stub test, 'run', (callback) -> callback()

Expand Down Expand Up @@ -235,7 +235,7 @@ describe 'Test Runner', ->
options =
server: "#{SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub runner.mocha, 'run', (callback) -> callback()
sinon.stub test, 'run', (callback) -> callback()
hooksStub.skippedTests = [test.name]
Expand Down Expand Up @@ -271,7 +271,7 @@ describe 'Test Runner', ->
options =
server: "#{SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub runner.mocha, 'run', (callback) -> callback()
sinon.stub test, 'run', (callback) -> callback()

Expand Down Expand Up @@ -314,7 +314,7 @@ describe 'Test Runner', ->
options =
server: "#{SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
# sinon.stub runner.mocha, 'run', (callback) -> callback()
testStub = sinon.stub test, 'run'
testStub.throws('AssertionError')
Expand Down Expand Up @@ -356,7 +356,7 @@ describe 'Test Runner', ->
options =
server: "#{SERVER}"

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub test, 'run', (callback) ->
callback()

Expand Down Expand Up @@ -392,7 +392,7 @@ describe 'Test Runner', ->
options =
names: true

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub runner.mocha, 'run', (callback) -> callback()
sinon.spy console, 'log'

Expand Down Expand Up @@ -433,7 +433,7 @@ describe 'Test Runner', ->
server: "#{SERVER}"
header: header

runner = new TestRunner options
runner = new TestRunner options, ''
sinon.stub runner.mocha, 'run', (callback) ->
receivedTest = _.clone(test)
callback()
Expand Down Expand Up @@ -467,7 +467,7 @@ describe 'Test Runner', ->
server: "#{SERVER}"
'hooks-only': true

runner = new TestRunner options
runner = new TestRunner options, ''

mochaStub = runner.mocha
originSuiteCreate = mocha.Suite.create
Expand Down

0 comments on commit b525c08

Please sign in to comment.