Permalink
Browse files

Try delay run of tests for Travis

  • Loading branch information...
1 parent 0c3226a commit dd26a7f1e780e352b31f3edbe8bab58e0c1916fb @HookyQR committed Oct 15, 2016
Showing with 98 additions and 88 deletions.
  1. +4 −0 appveyor.yml
  2. +91 −86 test/extension.test.js
  3. +3 −2 test/index.js
View
@@ -6,6 +6,10 @@ install:
- npm install -g npm
- npm install
+platform:
+ - x86
+ - x64
+
build: off
test_script:
View
@@ -120,92 +120,60 @@ function doSaveEach(fmt) {
});
});
}
-describe("VS code beautify", function() {
- this.timeout(slow * 2);
- this.slow(slow);
- before(() => {
- testData.clean(root);
- vscode.commands.executeCommand("workbench.action.toggleSidebarVisibility");
- });
- let eolstr = {
- "\\n": ["lf", vscode.EndOfLine.LF],
- "\\r\\n": ["crlf", vscode.EndOfLine.CRLF]
- };
- Object.keys(eolstr)
- .forEach(eol => {
- let config = {
- jsbeautify: [{
- eol: eol
+// delay test start to give vscode a chance to load (For Travis OSX)
+setTimeout(function() {
+ describe("VS code beautify", function() {
+ this.timeout(slow * 2);
+ this.slow(slow);
+ before(() => {
+ testData.clean(root);
+ vscode.commands.executeCommand("workbench.action.toggleSidebarVisibility");
+ });
+
+ let eolstr = {
+ "\\n": ["lf", vscode.EndOfLine.LF],
+ "\\r\\n": ["crlf", vscode.EndOfLine.CRLF]
+ };
+ Object.keys(eolstr)
+ .forEach(eol => {
+ let config = {
+ jsbeautify: [{
+ eol: eol
}, `root = true\r\n[*]\r\nend_of_line = lf\r\nindent_style = tab\r\nindent_size = 2\r\n`],
- editorconfig: [null,
+ editorconfig: [null,
`root = true\r\n[*]\r\nend_of_line = ${eolstr[eol][0]}\r\nindent_style = space\r\nindent_size = 4`],
- 'vs code': [null, ""]
- };
- Object.keys(config)
- .forEach(cfg => {
- context(`with ${cfg} cr set to '${eol}'`, function() {
- before(() => setupConfigs(config[cfg][0], config[cfg][1]));
- beautifyEach(eolstr[eol]);
- //this combo doesn't work on AV. Seems there's another formatter being called
- if (process.platform === 'win32' && cfg === 'vs code' && eol === "\\n") return;
- formatEach(eolstr[eol]);
+ 'vs code': [null, ""]
+ };
+ Object.keys(config)
+ .forEach(cfg => {
+ context(`with ${cfg} cr set to '${eol}'`, function() {
+ before(() => setupConfigs(config[cfg][0], config[cfg][1]));
+ beautifyEach(eolstr[eol]);
+ //this combo doesn't work on AV. Seems there's another formatter being called
+ if (process.platform === 'win32' && cfg === 'vs code' && eol === "\\n") return;
+ formatEach(eolstr[eol]);
+ });
});
- });
- });
- let config = {
- jsbeautify: [{
- eol: "\n",
- indent_with_tabs: true
+ });
+ let config = {
+ jsbeautify: [{
+ eol: "\n",
+ indent_with_tabs: true
}, ""],
- editorconfig: [null, `root = true\r\n[*]\r\nend_of_line = lf\r\nindent_style = tab\r\nindent_size = 2\r\n`]
- };
- Object.keys(config)
- .forEach(cfg => {
- context(`with ${cfg} indent set to 'tab'`, function() {
- before(() => setupConfigs(config[cfg][0], config[cfg][1]));
- beautifyEach(['tab', vscode.EndOfLine.LF]);
- formatEach(['tab', vscode.EndOfLine.LF]);
+ editorconfig: [null, `root = true\r\n[*]\r\nend_of_line = lf\r\nindent_style = tab\r\nindent_size = 2\r\n`]
+ };
+ Object.keys(config)
+ .forEach(cfg => {
+ context(`with ${cfg} indent set to 'tab'`, function() {
+ before(() => setupConfigs(config[cfg][0], config[cfg][1]));
+ beautifyEach(['tab', vscode.EndOfLine.LF]);
+ formatEach(['tab', vscode.EndOfLine.LF]);
+ });
});
- });
- // nested config
- context('with nested config', function() {
- before(() => setupConfigs({
- js: {
- indent_size: 5
- },
- css: {
- indent_size: 4
- },
- html: {
- indent_size: 3
- },
- eol: "\r\n",
- indent_with_tabs: false,
- indent_size: 2
- }, ""));
- beautifyEach(['nested', vscode.EndOfLine.CRLF]);
- formatEach(['nested', vscode.EndOfLine.CRLF]);
- });
-
- context('partial', function() {
- before(() => setupConfigs({
- eol: "\r\n",
- indent_with_tabs: false,
- indent_size: 2
- }, ""));
- beautifyPartialEach(['partial', vscode.EndOfLine.LF]);
- });
- context('on save', function() {
- this.timeout(slow * 4);
- this.slow(slow * 2);
- let preconfig;
- before(() => {
- preconfig = fs.readFileSync(path.join(__dirname, '.vscode', 'settings.json'), 'utf8');
- const asObj = JSON.parse(preconfig);
- asObj["beautify.onSave"] = true;
- fs.writeFileSync(path.join(__dirname, '.vscode', 'settings.json'), JSON.stringify(asObj));
- return setupConfigs({
+ // nested config
+ context('with nested config', function() {
+ before(() => setupConfigs({
js: {
indent_size: 5
},
@@ -218,12 +186,49 @@ describe("VS code beautify", function() {
eol: "\r\n",
indent_with_tabs: false,
indent_size: 2
- }, "");
+ }, ""));
+ beautifyEach(['nested', vscode.EndOfLine.CRLF]);
+ formatEach(['nested', vscode.EndOfLine.CRLF]);
});
- after(() => {
- fs.writeFileSync(path.join(__dirname, '.vscode', 'settings.json'), preconfig);
- testData.clean(root);
+
+ context('partial', function() {
+ before(() => setupConfigs({
+ eol: "\r\n",
+ indent_with_tabs: false,
+ indent_size: 2
+ }, ""));
+ beautifyPartialEach(['partial', vscode.EndOfLine.LF]);
+ });
+ context('on save', function() {
+ this.timeout(slow * 4);
+ this.slow(slow * 2);
+ let preconfig;
+ before(() => {
+ preconfig = fs.readFileSync(path.join(__dirname, '.vscode', 'settings.json'), 'utf8');
+ const asObj = JSON.parse(preconfig);
+ asObj["beautify.onSave"] = true;
+ fs.writeFileSync(path.join(__dirname, '.vscode', 'settings.json'), JSON.stringify(asObj));
+ return setupConfigs({
+ js: {
+ indent_size: 5
+ },
+ css: {
+ indent_size: 4
+ },
+ html: {
+ indent_size: 3
+ },
+ eol: "\r\n",
+ indent_with_tabs: false,
+ indent_size: 2
+ }, "");
+ });
+ after(() => {
+ fs.writeFileSync(path.join(__dirname, '.vscode', 'settings.json'), preconfig);
+ testData.clean(root);
+ });
+ doSaveEach(['nested', vscode.EndOfLine.CRLF]);
});
- doSaveEach(['nested', vscode.EndOfLine.CRLF]);
});
-});
+ run();
+}, 3000);
View
@@ -2,7 +2,8 @@
let runner = require('vscode/lib/testrunner');
runner.configure({
- useColors: true
+ useColors: true,
+ delay: true
});
-module.exports = runner;
+module.exports = runner;

0 comments on commit dd26a7f

Please sign in to comment.