Fix failing PHP-CS-Fixer Beautifier specs, disable some on Windows
This commit is contained in:
parent
b0d8dfa6fb
commit
6b7b3d6401
|
@ -7,6 +7,11 @@ Beautifier = require "../src/beautifiers/beautifier"
|
||||||
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
||||||
# or `fdescribe`). Remove the `f` to unfocus the block.
|
# or `fdescribe`). Remove the `f` to unfocus the block.
|
||||||
|
|
||||||
|
# Check if Windows
|
||||||
|
isWindows = process.platform is 'win32' or
|
||||||
|
process.env.OSTYPE is 'cygwin' or
|
||||||
|
process.env.OSTYPE is 'msys'
|
||||||
|
|
||||||
describe "Atom-Beautify", ->
|
describe "Atom-Beautify", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
|
@ -139,6 +144,7 @@ describe "Atom-Beautify", ->
|
||||||
p.then(cb, cb)
|
p.then(cb, cb)
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
unless isWindows
|
||||||
it "should error with Mac/Linux-specific help description \
|
it "should error with Mac/Linux-specific help description \
|
||||||
when beautifier's program not found", ->
|
when beautifier's program not found", ->
|
||||||
expect(beautifier).not.toBe(null)
|
expect(beautifier).not.toBe(null)
|
||||||
|
|
|
@ -7,6 +7,11 @@ path = require 'path'
|
||||||
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
||||||
# or `fdescribe`). Remove the `f` to unfocus the block.
|
# or `fdescribe`). Remove the `f` to unfocus the block.
|
||||||
|
|
||||||
|
# Check if Windows
|
||||||
|
isWindows = process.platform is 'win32' or
|
||||||
|
process.env.OSTYPE is 'cygwin' or
|
||||||
|
process.env.OSTYPE is 'msys'
|
||||||
|
|
||||||
describe "PHP-CS-Fixer Beautifier", ->
|
describe "PHP-CS-Fixer Beautifier", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
|
@ -43,11 +48,13 @@ describe "PHP-CS-Fixer Beautifier", ->
|
||||||
fixers: ""
|
fixers: ""
|
||||||
levels: ""
|
levels: ""
|
||||||
}
|
}
|
||||||
# Mock PATH
|
# Mock spawn
|
||||||
beautifier.getShellEnvironment = -> Promise.resolve({
|
beautifier.spawn = (exe, args, options) ->
|
||||||
PATH: ''
|
# console.log('spawn', exe, args, options)
|
||||||
})
|
er = new Error('ENOENT')
|
||||||
#
|
er.code = 'ENOENT'
|
||||||
|
return beautifier.Promise.reject(er)
|
||||||
|
# Beautify
|
||||||
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)
|
||||||
|
@ -119,6 +126,7 @@ describe "PHP-CS-Fixer Beautifier", ->
|
||||||
failWhichProgram('php')
|
failWhichProgram('php')
|
||||||
failWhichProgram('php-cs-fixer')
|
failWhichProgram('php-cs-fixer')
|
||||||
|
|
||||||
|
unless isWindows
|
||||||
describe "Mac/Linux", ->
|
describe "Mac/Linux", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
|
|
|
@ -10,6 +10,11 @@ JsDiff = require('diff')
|
||||||
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
|
||||||
# or `fdescribe`). Remove the `f` to unfocus the block.
|
# or `fdescribe`). Remove the `f` to unfocus the block.
|
||||||
|
|
||||||
|
# Check if Windows
|
||||||
|
isWindows = process.platform is 'win32' or
|
||||||
|
process.env.OSTYPE is 'cygwin' or
|
||||||
|
process.env.OSTYPE is 'msys'
|
||||||
|
|
||||||
describe "BeautifyLanguages", ->
|
describe "BeautifyLanguages", ->
|
||||||
|
|
||||||
optionsDir = path.resolve(__dirname, "../examples")
|
optionsDir = path.resolve(__dirname, "../examples")
|
||||||
|
@ -47,10 +52,6 @@ describe "BeautifyLanguages", ->
|
||||||
# Force activate package
|
# Force activate package
|
||||||
pack = atom.packages.getLoadedPackage("atom-beautify")
|
pack = atom.packages.getLoadedPackage("atom-beautify")
|
||||||
pack.activateNow()
|
pack.activateNow()
|
||||||
# Check if Windows
|
|
||||||
isWindows = process.platform is 'win32' or
|
|
||||||
process.env.OSTYPE is 'cygwin' or
|
|
||||||
process.env.OSTYPE is 'msys'
|
|
||||||
# Need more debugging on Windows
|
# Need more debugging on Windows
|
||||||
if isWindows
|
if isWindows
|
||||||
# Change logger level
|
# Change logger level
|
||||||
|
|
Loading…
Reference in New Issue