Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 22ab40f

Browse files
committed
style(protractor): fix indentation and style in config files
1 parent e2350ca commit 22ab40f

File tree

3 files changed

+68
-70
lines changed

3 files changed

+68
-70
lines changed

test_e2e/configQuery.js

+31-33
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
var env = process.env,
2-
fs = require('fs'),
3-
path = require('path');
4-
5-
6-
var runningOnTravis = (env.TRAVIS !== undefined);
2+
fs = require('fs'),
3+
path = require('path'),
4+
runningOnTravis = (env.TRAVIS !== undefined);
75

86

97
function getBaseUrl(configWithEnvKey) {
108
if (env[configWithEnvKey.envVar]) {
11-
return env[configWithEnvKey.envVar];
9+
return env[configWithEnvKey.envVar];
1210
} else if (env.USER == 'chirayu') {
13-
return 'http://example.ngdart.localhost';
11+
return 'http://example.ngdart.localhost';
1412
} else {
15-
// Default host:port when you run "pub serve" from the example
16-
// subdirectory of the AngularDart repo.
17-
return 'http://localhost:8080';
13+
// Default host:port when you run "pub serve" from the example
14+
// subdirectory of the AngularDart repo.
15+
return 'http://localhost:8080';
1816
}
1917
}
2018

2119

2220
function getDartiumBinary() {
23-
var ensure = function(condition) {
24-
if (!condition) throw "Unable to locate Dartium. Please set the DARTIUM environment variable.";
21+
function ensure(condition) {
22+
if (!condition) throw "Unable to locate Dartium. Please set the DARTIUM environment variable.";
2523
};
2624

2725
if (env.DARTIUM) {
28-
return env.DARTIUM;
26+
return env.DARTIUM;
2927
}
3028
var platform = require('os').platform();
3129
var DART_SDK = env.DART_SDK;
3230
if (DART_SDK) {
33-
// Locate the chromium directory as a sibling of the DART_SDK
34-
// directory. (It's there if you unpacked the full Dart distribution.)
35-
var chromiumRoot = path.join(DART_SDK, "../chromium");
36-
ensure(fs.existsSync(chromiumRoot));
37-
var binary = path.join(chromiumRoot,
38-
(platform == 'darwin') ? 'Chromium.app/Contents/MacOS/Chromium' : 'chrome');
39-
ensure(fs.existsSync(binary));
40-
return binary;
31+
// Locate the chromium directory as a sibling of the DART_SDK
32+
// directory. (It's there if you unpacked the full Dart distribution.)
33+
var chromiumRoot = path.join(DART_SDK, "../chromium");
34+
ensure(fs.existsSync(chromiumRoot));
35+
var binary = path.join(chromiumRoot,
36+
(platform == 'darwin') ? 'Chromium.app/Contents/MacOS/Chromium' : 'chrome');
37+
ensure(fs.existsSync(binary));
38+
return binary;
4139
}
42-
// Last resort: Try the standard location on Macs for the AngularDart team.
40+
// Last resort: Try the standard location on Macs for the AngularDart team.
4341
var binary = '/Applications/dart/chromium/Chromium.app/Contents/MacOS/Chromium';
4442
ensure(platform == 'darwin' && fs.existsSync(binary));
4543
return binary;
@@ -48,21 +46,21 @@ function getDartiumBinary() {
4846

4947
function getChromeOptions() {
5048
if (!runningOnTravis) {
51-
return {'binary': getDartiumBinary()};
49+
return {'binary': getDartiumBinary()};
5250
}
53-
// In Travis, the list of browsers to test is specified as a CSV in the
54-
// BROWSERS environment variable.
55-
// TODO(chirayu): Parse the BROWSERS csv so we also test on Firefox.
51+
// In Travis, the list of browsers to test is specified as a CSV in the
52+
// BROWSERS environment variable.
53+
// TODO(chirayu): Parse the BROWSERS csv so we also test on Firefox.
5654
if (env.TESTS == "vm") {
57-
return {'binary': env.DARTIUM_BIN};
55+
return {'binary': env.DARTIUM_BIN};
5856
}
5957
if (env.TESTS == "dart2js") {
60-
return {
61-
'binary': env.CHROME_BIN,
62-
// Ref: https://github.com/travis-ci/travis-ci/issues/938
63-
// https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start
64-
'args': ['no-sandbox=true']
65-
};
58+
return {
59+
'binary': env.CHROME_BIN,
60+
// Ref: https://github.com/travis-ci/travis-ci/issues/938
61+
// https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start
62+
'args': ['no-sandbox=true']
63+
};
6664
}
6765
throw new Error("Unknown Travis configuration specified by TESTS variable");
6866
}

test_e2e/examplesConf.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,42 @@ var config = {
1616
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
1717

1818
specs: [
19-
'animation_spec.dart',
20-
'hello_world_spec.dart',
21-
'todo_spec.dart'
19+
'animation_spec.dart',
20+
'hello_world_spec.dart',
21+
'todo_spec.dart'
2222
],
2323

2424
splitTestsBetweenCapabilities: true,
2525

2626
multiCapabilities: [{
27-
'browserName': 'chrome',
28-
'chromeOptions': configQuery.getChromeOptions(),
29-
count: 4
27+
browserName: 'chrome',
28+
chromeOptions: configQuery.getChromeOptions(),
29+
count: 4
3030
}],
3131

3232
baseUrl: configQuery.getBaseUrl({
33-
envVar: "TEST_EXAMPLE_BASEURL"
33+
envVar: "TEST_EXAMPLE_BASEURL"
3434
}),
3535

3636
jasmineNodeOpts: {
37-
isVerbose: true, // display spec names.
38-
showColors: true, // print colors to the terminal.
39-
includeStackTrace: true, // include stack traces in failures.
40-
defaultTimeoutInterval: 80000 // wait time in ms before failing a test.
37+
isVerbose: true, // display spec names.
38+
showColors: true, // print colors to the terminal.
39+
includeStackTrace: true, // include stack traces in failures.
40+
defaultTimeoutInterval: 80000 // wait time in ms before failing a test.
4141
},
4242
};
4343

4444
// Saucelabs case.
4545
if (process.env.SAUCE_USERNAME != null) {
46-
config.sauceUser = process.env.SAUCE_USERNAME;
47-
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
48-
config.seleniumAddress = null;
49-
50-
config.multiCapabilities.forEach(function(capability) {
51-
capability['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
52-
capability['build'] = process.env.TRAVIS_BUILD_NUMBER;
53-
capability['name'] = 'AngularDart E2E Suite';
54-
});
46+
config.sauceUser = process.env.SAUCE_USERNAME;
47+
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
48+
config.seleniumAddress = null;
49+
50+
config.multiCapabilities.forEach(function(capability) {
51+
capability['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
52+
capability['build'] = process.env.TRAVIS_BUILD_NUMBER;
53+
capability['name'] = 'AngularDart E2E Suite';
54+
});
5555
}
5656

5757
exports.config = config;

test_transformers/transformersE2eConf.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,35 @@ var config = {
1919
specs: ['relative_uris_spec.dart'],
2020

2121
multiCapabilities: [{
22-
'browserName': 'chrome',
23-
'chromeOptions': configQuery.getChromeOptions(),
24-
count: 1
22+
browserName: 'chrome',
23+
chromeOptions: configQuery.getChromeOptions(),
24+
count: 1
2525
}],
2626

2727
baseUrl: configQuery.getBaseUrl({
28-
envVar: "TEST_TRANSFORMERS_BASEURL"
28+
envVar: "TEST_TRANSFORMERS_BASEURL"
2929
}),
3030

3131

3232
jasmineNodeOpts: {
33-
isVerbose: true, // display spec names.
34-
showColors: true, // print colors to the terminal.
35-
includeStackTrace: true, // include stack traces in failures.
36-
defaultTimeoutInterval: 80000 // wait time in ms before failing a test.
33+
isVerbose: true, // display spec names.
34+
showColors: true, // print colors to the terminal.
35+
includeStackTrace: true, // include stack traces in failures.
36+
defaultTimeoutInterval: 80000 // wait time in ms before failing a test.
3737
},
3838
};
3939

4040
// Saucelabs case.
4141
if (process.env.SAUCE_USERNAME != null) {
42-
config.sauceUser = process.env.SAUCE_USERNAME;
43-
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
44-
config.seleniumAddress = null;
45-
46-
config.multiCapabilities.forEach(function(capability) {
47-
capability['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
48-
capability['build'] = process.env.TRAVIS_BUILD_NUMBER;
49-
capability['name'] = 'AngularDart Transformers E2E Suite';
50-
});
42+
config.sauceUser = process.env.SAUCE_USERNAME;
43+
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
44+
config.seleniumAddress = null;
45+
46+
config.multiCapabilities.forEach(function(capability) {
47+
capability['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
48+
capability['build'] = process.env.TRAVIS_BUILD_NUMBER;
49+
capability['name'] = 'AngularDart Transformers E2E Suite';
50+
});
5151
}
5252

5353
exports.config = config;

0 commit comments

Comments
 (0)