Fix typo in php-cs-fixer spec, mocking env should be object
This commit is contained in:
parent
817cab6ce4
commit
8ff76bc41d
|
@ -39,17 +39,21 @@ describe "PHP-CS-Fixer Beautifier", ->
|
||||||
fixers: ""
|
fixers: ""
|
||||||
levels: ""
|
levels: ""
|
||||||
}
|
}
|
||||||
# Mock
|
# Mock PATH
|
||||||
beautifier.getShellEnvironment = -> Promise.resolve("")
|
beautifier.getShellEnvironment = -> Promise.resolve({
|
||||||
|
PATH: ''
|
||||||
|
})
|
||||||
#
|
#
|
||||||
p = beautifier.beautify(text, language, options)
|
p = beautifier.beautify(text, language, options)
|
||||||
expect(p).not.toBe(null)
|
expect(p).not.toBe(null)
|
||||||
expect(p instanceof beautifier.Promise).toBe(true)
|
expect(p instanceof beautifier.Promise).toBe(true)
|
||||||
cb = (v) ->
|
cb = (v) ->
|
||||||
console.log(v)
|
# console.log(v)
|
||||||
expect(v).not.toBe(null)
|
expect(v).not.toBe(null)
|
||||||
expect(v instanceof Error).toBe(true)
|
expect(v instanceof Error).toBe(true, \
|
||||||
expect(v.code).toBe("CommandNotFound")
|
"Expected #{v} to be instance of Error")
|
||||||
|
expect(v.code).toBe("CommandNotFound", \
|
||||||
|
"Expected to be CommandNotFound")
|
||||||
return v
|
return v
|
||||||
p.then(cb, cb)
|
p.then(cb, cb)
|
||||||
return p
|
return p
|
||||||
|
|
Loading…
Reference in New Issue