-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
190 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules | ||
*.vsix | ||
.vscodeignore | ||
typings | ||
.vscode-test | ||
.vscode | ||
.jshintrc | ||
.jshintrc | ||
typings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
language: node_js | ||
node_js: | ||
- "4.1" | ||
- "stable" | ||
os: | ||
- osx | ||
- linux | ||
|
||
before_install: | ||
- if [ $TRAVIS_OS_NAME == "linux" ]; then | ||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; | ||
sh -e /etc/init.d/xvfb start; | ||
sleep 3; | ||
fi | ||
|
||
env: | ||
- CODE_VERSION="0.10.1" | ||
- CODE_VERSION="0.10.9" | ||
- CODE_VERSION="1.0.0" | ||
|
||
install: | ||
- npm install | ||
|
||
script: | ||
- npm test --silent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"indent_with_tabs": true, | ||
"css": { | ||
"selector_separator_newline": true | ||
}, | ||
"js": { | ||
"break_chained_methods": true, | ||
"max_preserve_newlines": 2 | ||
}, | ||
"html": { | ||
"brace_style": "none", | ||
"preserve_newlines": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.a, #b{border: 1px solid green} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<html><head><title>abc</title></head><body><a href='https://github.com/HookyQR/VSCodeBeautify' data-blank="blank">beautify for VS Code</a> | ||
|
||
|
||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var a=1;function b(x){return x;}b(a).toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{"test": 1, "test2": "test3", | ||
|
||
|
||
"test4":["test5",6] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.a, | ||
#b { | ||
border: 1px solid green | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
|
||
<head> | ||
<title>abc</title> | ||
</head> | ||
|
||
<body><a href='https://github.com/HookyQR/VSCodeBeautify' data-blank="blank">beautify for VS Code</a> </body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var a = 1; | ||
|
||
function b(x) { | ||
return x; | ||
} | ||
b(a) | ||
.toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"test": 1, | ||
"test2": "test3", | ||
|
||
"test4": ["test5", 6] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.a, | ||
#b { | ||
border: 1px solid green | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html> | ||
|
||
<head> | ||
<title>abc</title> | ||
</head> | ||
|
||
<body><a href='https://github.com/HookyQR/VSCodeBeautify' data-blank="blank">beautify for VS Code</a> | ||
|
||
|
||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var a = 1; | ||
|
||
function b(x) { | ||
return x; | ||
} | ||
b(a).toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"test": 1, | ||
"test2": "test3", | ||
|
||
|
||
"test4": ["test5", 6] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use strict'; | ||
let vscode = require('vscode'), | ||
expect = require('expect.js'), | ||
path = require('path'), | ||
fs = require('fs'); | ||
|
||
let root = path.join(path.dirname(__filename), 'data'); | ||
|
||
describe('with empty .jsbeautify', () => { | ||
beforeEach(() => fs.writeFileSync(path.join(root, '.jsbeautifyrc'), "{}")); | ||
|
||
['.js', '.html', '.json', '.css'].forEach(extension => | ||
it('beautify of "' + extension + "'", () => vscode.workspace.openTextDocument(path.join(root, 'in' + extension)) | ||
.then(doc => vscode.window.showTextDocument(doc) | ||
.then(() => vscode.commands.executeCommand('HookyQR.beautify') | ||
.then(() => expect(doc.getText()) | ||
.to.be(fs.readFileSync(path.join(root, 'out' + extension), 'utf8'))))))); | ||
|
||
['.html', '.css'].forEach(extension => | ||
it('format of "' + extension + "'", () => vscode.workspace.openTextDocument(path.join(root, 'in' + extension)) | ||
.then(doc => vscode.window.showTextDocument(doc) | ||
.then(() => vscode.commands.executeCommand('editor.action.format') | ||
.then(() => expect(doc.getText()) | ||
.to.be(fs.readFileSync(path.join(root, 'out' + extension), 'utf8'))))))); | ||
}); | ||
|
||
describe('with nested options in .jsbeautify', () => { | ||
beforeEach(() => fs.writeFileSync(path.join(root, '.jsbeautifyrc'), | ||
`{ | ||
"indent_with_tabs": true, | ||
"css": { | ||
"selector_separator_newline": true | ||
}, | ||
"js": { | ||
"break_chained_methods": true, | ||
"max_preserve_newlines": 2 | ||
}, | ||
"html": { | ||
"brace_style": "none", | ||
"preserve_newlines": false | ||
} | ||
}` | ||
)); | ||
|
||
['.js', '.html', '.json', '.css'].forEach(extension => | ||
it('beautify of "' + extension + "'", () => vscode.workspace.openTextDocument(path.join(root, 'in' + extension)) | ||
.then(doc => vscode.window.showTextDocument(doc) | ||
.then(() => vscode.commands.executeCommand('HookyQR.beautify') | ||
.then(() => expect(doc.getText()) | ||
.to.be(fs.readFileSync(path.join(root, 'out.2' + extension), 'utf8'))))))); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
let runner = require('vscode/lib/testrunner'); | ||
|
||
runner.configure({ | ||
useColors: true | ||
}); | ||
|
||
module.exports = runner; |