Skip to content

Commit

Permalink
fix code style issue
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed Jul 9, 2017
1 parent 1cc651a commit b969f95
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ Config.prototype.mergeUrlAndQueryParams = function(urlString, queryParamsObj) {
});
urlObj.query = outputQueryParams;
urlObj.search = querystring.stringify(outputQueryParams)
.replace(/\=&/g, '&')
.replace(/=$/, '');
.replace(/=&/g, '&')
.replace(/=$/, '');
urlObj.path = urlObj.pathname + urlObj.search;
return url.format(urlObj);
};
Expand Down
10 changes: 5 additions & 5 deletions lib/reporters/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ module.exports = View.extend({

if (err) {
var errMsgs = new StyledString('\n' + err.name)
.foreground('white')
.concat(new StyledString('\n' + err.message).foreground('red'));
.foreground('white')
.concat(new StyledString('\n' + err.message).foreground('red'));

title += errMsgs;
}
Expand Down Expand Up @@ -251,9 +251,9 @@ module.exports = View.extend({

var msg = (
!this.get('atLeastOneRunner') ?
'q to quit' :
'Press ENTER to run tests; q to quit'
);
'q to quit' :
'Press ENTER to run tests; q to quit'
);
msg = '[' + msg + pauseStatus + ']';
screen
.position(0, this.get('lines'))
Expand Down
4 changes: 2 additions & 2 deletions lib/strutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function pad(str, l, s, t) {
var ol = l;
return (s || (s = ' '), (l -= str.length) > 0 ?
(s = new Array(Math.ceil(l / s.length) + 1).join(s))
.substr(0, t = !t ? l : t === 1 ? 0 :
Math.ceil(l / 2)) + str + s.substr(0, l - t) : str).substring(0, ol);
.substr(0, t = !t ? l : t === 1 ? 0 :
Math.ceil(l / 2)) + str + s.substr(0, l - t) : str).substring(0, ol);
}

function indent(text, width) {
Expand Down
12 changes: 6 additions & 6 deletions lib/utils/known-browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function knownBrowsers(platform, config) {
},
{
name: 'Chrome',
possiblePath: chromeWinPaths(userHomeDir, 'Chrome').concat(chromeOSXPaths('Google\ Chrome')),
possiblePath: chromeWinPaths(userHomeDir, 'Chrome').concat(chromeOSXPaths('Google Chrome')),
possibleExe: [
'google-chrome',
'google-chrome-stable'
Expand All @@ -97,7 +97,7 @@ function knownBrowsers(platform, config) {
// On Windows, Chrome Stable/Beta/Dev are installed on the same path
{
name: 'Chrome Beta',
possiblePath: chromeOSXPaths('Google\ Chrome\ Beta'),
possiblePath: chromeOSXPaths('Google Chrome Beta'),
possibleExe: [
'google-chrome-beta'
],
Expand All @@ -107,7 +107,7 @@ function knownBrowsers(platform, config) {
},
{
name: 'Chrome Dev',
possiblePath: chromeOSXPaths('Google\ Chrome\ Dev'),
possiblePath: chromeOSXPaths('Google Chrome Dev'),
possibleExe: [
'google-chrome-unstable'
],
Expand All @@ -119,7 +119,7 @@ function knownBrowsers(platform, config) {
// Chrome Canary is not available on Linux
{
name: 'Chrome Canary',
possiblePath: chromeWinPaths(userHomeDir, 'Chrome SxS').concat(chromeOSXPaths('Google\ Chrome\ Canary')),
possiblePath: chromeWinPaths(userHomeDir, 'Chrome SxS').concat(chromeOSXPaths('Google Chrome Canary')),
args: function(config, url) {
return chromeArgs(this.browserTmpDir(), url);
}
Expand Down Expand Up @@ -200,8 +200,8 @@ function knownBrowsers(platform, config) {
browsers.push({
name: 'Safari Technology Preview',
possiblePath: [
process.env.HOME + '/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview',
'/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview'
process.env.HOME + '/Applications/Safari Technology Preview.app/Contents/MacOS/Safari Technology Preview',
'/Applications/Safari Technology Preview.app/Contents/MacOS/Safari Technology Preview'
],
setup: function(config, done) {
var url = this.getUrl();
Expand Down
2 changes: 1 addition & 1 deletion public/testem/decycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function decycle(object, maxDepth) {
for (name in value) {
if (Object.prototype.hasOwnProperty.call(value, name)) {
nu[name] = derez(value[name],
path + '[' + JSON.stringify(name) + ']', depth + 1);
path + '[' + JSON.stringify(name) + ']', depth + 1);
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions tests/ci/reporter_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ describe('test reporters', function() {
it('writes out and XML escapes results', function() {
var reporter = new XUnitReporter(false, stream, config);
reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});
reporter.finish();
var output = stream.read().toString();
assert.match(output, /<testsuite name="Testem Tests" tests="1" skipped="0" failures="0" timestamp="(.+)" time="(\d+(\.\d+)?)">/);
assert.match(output, /<testcase classname="phantomjs" name="it does &lt;cool> &quot;cool&quot; \'cool\' stuff"/);
assert.match(output, /<testcase classname="phantomjs" name="it does &lt;cool> &quot;cool&quot; 'cool' stuff"/);

assertXmlIsValid(output);
});
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('test reporters', function() {
reporter.finish();
var output = stream.read().toString();
assert.match(output, /it didnt work/);
assert.match(output, /<error message=\"it crapped out\">/);
assert.match(output, /<error message="it crapped out">/);
assert.match(output, /CDATA\[Error: it crapped out/);

assertXmlIsValid(output);
Expand All @@ -369,7 +369,7 @@ describe('test reporters', function() {
reporter.finish();
var output = stream.read().toString();
assert.match(output, /it didnt work/);
assert.match(output, /<error message=\"it crapped out\"\/>/);
assert.match(output, /<error message="it crapped out"\/>/);
assert.notMatch(output, /CDATA\[Error: it crapped out/);

assertXmlIsValid(output);
Expand Down Expand Up @@ -422,7 +422,7 @@ describe('test reporters', function() {
name: 'it failed with quotes',
passed: false,
error: {
message: (new Error('<it> \"crapped\" out')).stack
message: (new Error('<it> "crapped" out')).stack
}
});
reporter.finish();
Expand Down Expand Up @@ -472,7 +472,7 @@ describe('test reporters', function() {
it('writes out and XML escapes results', function() {
var reporter = new TeamcityReporter(false, stream);
reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});
reporter.report('phantomjs', {
Expand Down
22 changes: 11 additions & 11 deletions tests/config_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ describe('Config', function() {

sandbox.stub(browserLauncher, 'getAvailableBrowsers', function(config, browsers, cb) {
cb(null, [
{name: 'Chrome', exe: 'chrome.exe'},
{name: 'Firefox'}
{name: 'Chrome', exe: 'chrome.exe'},
{name: 'Firefox'}
]);
});

Expand Down Expand Up @@ -405,7 +405,7 @@ describe('Config', function() {
});
it('populates attributes for only the desired globs', function(done) {
config.set('src_files', [
{src: 'config_tests.js', attrs: ['data-foo="true"', 'data-bar']},
{src: 'config_tests.js', attrs: ['data-foo="true"', 'data-bar']},
'ci/*'
]);
config.getSrcFiles(function(err, files) {
Expand Down Expand Up @@ -568,17 +568,17 @@ describe('Config', function() {

function mockTopLevelProgOptions() {
var options = [
{ name: function() { return 'timeout'; } }
{ name: function() { return 'timeout'; } }
];
var commands = [
{ name: function() { return 'ci'; } },
{ name: function() { return 'launchers'; } }
{ name: function() { return 'ci'; } },
{ name: function() { return 'launchers'; } }
];
var parentOptions = {
port: 8081,
options: [
{name: function() { return 'port'; }},
{name: function() { return 'launcher'; }}
{name: function() { return 'port'; }},
{name: function() { return 'launcher'; }}
],
cwd: 'tests'
};
Expand All @@ -604,11 +604,11 @@ describe('getTemplateData', function() {
var config = new Config('dev', progOptions, fileConfig);
config.getTemplateData(function(err, data) {
expect(data.serve_files).to.deep.have.members([
{ src: 'web/hello.js', attrs: [] },
{ src: 'web/hello_tst.js', attrs: [] }
{ src: 'web/hello.js', attrs: [] },
{ src: 'web/hello_tst.js', attrs: [] }
]);
expect(data.css_files).to.deep.have.members([
{ src: '', attrs: [] }
{ src: '', attrs: [] }
]);
done();
});
Expand Down
4 changes: 2 additions & 2 deletions tests/runners/tap_process_test_runner_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('tap process test runner', function() {
var failingItems = failingTest.result.items;
var stack = failingItems[0].stack;
expect(typeof stack).to.equal('string');
expect(stack).to.match(/Error\:/);
expect(stack).to.match(/Error:/);

done();
});
Expand Down Expand Up @@ -272,7 +272,7 @@ describe('tap process test runner', function() {

var failingItems = failingTest.result.items;
var error = failingItems[0];
expect(error.stack).to.match(/Error\:/);
expect(error.stack).to.match(/Error:/);
expect(typeof error.stack).to.equal('string');
done();
});
Expand Down
2 changes: 1 addition & 1 deletion tests/server_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('Server', function() {

it('lists directories', function(done) {
request(baseUrl + 'data', function(err, req, text) {
expect(text).to.match(/<a href=\"blah.txt\">blah.txt<\/a>/);
expect(text).to.match(/<a href="blah.txt">blah.txt<\/a>/);
done();
});
});
Expand Down
8 changes: 4 additions & 4 deletions tests/utils/reporter_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('Reporter', function() {
expect(reporter.reporters.length).to.eq(1);

reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});
reporter.finish();
Expand All @@ -162,7 +162,7 @@ describe('Reporter', function() {
}, stream, path);

reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});

Expand Down Expand Up @@ -196,7 +196,7 @@ describe('Reporter', function() {
}, stream, path);

reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});
reporter.finish();
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('Reporter', function() {
}, stream, path);

reporter.report('phantomjs', {
name: 'it does <cool> \"cool\" \'cool\' stuff',
name: 'it does <cool> "cool" \'cool\' stuff',
passed: true
});
reporter.finish();
Expand Down

0 comments on commit b969f95

Please sign in to comment.