Skip to content

Commit 78bd2d7

Browse files
author
Robert Jackson
committed
npm run lint:js --- --fix
1 parent 0830f78 commit 78bd2d7

File tree

4 files changed

+28
-36
lines changed

4 files changed

+28
-36
lines changed

.eslintrc.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
module.exports = {
22
root: true,
3-
parserOptions: {
4-
sourceType: 'script',
5-
ecmaVersion: 2018
6-
},
7-
plugins: [
8-
'node',
9-
'prettier',
10-
],
11-
extends: [
12-
'eslint:recommended',
13-
'plugin:node/recommended'
14-
],
3+
parserOptions: {
4+
sourceType: 'script',
5+
ecmaVersion: 2018,
6+
},
7+
plugins: ['node', 'prettier'],
8+
extends: ['eslint:recommended', 'plugin:node/recommended'],
159
env: {
1610
browser: false,
17-
node: true
11+
node: true,
1812
},
1913
rules: {
2014
'prettier/prettier': 'error',
@@ -24,8 +18,8 @@ module.exports = {
2418
{
2519
files: ['tests/**/*.js'],
2620
env: {
27-
qunit: true
28-
}
29-
}
30-
]
21+
qunit: true,
22+
},
23+
},
24+
],
3125
};

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const got = require('got');
33

4-
module.exports = async function(channelType) {
4+
module.exports = async function (channelType) {
55
let HOST = process.env.EMBER_SOURCE_CHANNEL_URL_HOST || 'https://s3.amazonaws.com';
66
let PATH = 'builds.emberjs.com';
77

tests/helpers/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const getPort = require('get-port');
66

77
const host = (module.exports.host = 'localhost');
88

9-
module.exports.createServer = function() {
10-
return getPort().then(port => {
9+
module.exports.createServer = function () {
10+
return getPort().then((port) => {
1111
let s = http.createServer((req, resp) => s.emit(req.url, req, resp));
1212

1313
s.host = host;

tests/index-test.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ tmp.setGracefulCleanup();
1313
const ROOT = process.cwd();
1414
const EXECUTABLE_PATH = path.join(__dirname, '..', 'bin', 'ember-source-channel-url');
1515

16-
QUnit.module('ember-source-channel-url', function(hooks) {
16+
QUnit.module('ember-source-channel-url', function (hooks) {
1717
function randomString(length) {
1818
return crypto.randomBytes(Math.ceil(length / 2)).toString('hex');
1919
}
2020

21-
hooks.beforeEach(async function() {
21+
hooks.beforeEach(async function () {
2222
let dir = tmp.dirSync();
2323
process.chdir(dir.name);
2424

@@ -38,28 +38,26 @@ QUnit.module('ember-source-channel-url', function(hooks) {
3838
return server.listen(server.port);
3939
});
4040

41-
hooks.afterEach(function() {
41+
hooks.afterEach(function () {
4242
process.chdir(ROOT);
4343

4444
return this.server.close();
4545
});
4646

47-
QUnit.test('works', async function(assert) {
48-
let expected = `http://${this.server.host}:${this.server.port}/builds.emberjs.com${
49-
this.assetPath
50-
}`;
47+
QUnit.test('works', async function (assert) {
48+
let expected = `http://${this.server.host}:${this.server.port}/builds.emberjs.com${this.assetPath}`;
5149

5250
let actual = await getChannelURL('canary');
5351
assert.equal(actual, expected);
5452
});
5553

56-
QUnit.module('binary', function() {
57-
QUnit.test('works', async function(assert) {
54+
QUnit.module('binary', function () {
55+
QUnit.test('works', async function (assert) {
5856
let results = await execa(EXECUTABLE_PATH, ['canary']);
5957
assert.ok(results.stdout.includes(this.expectedURL), 'URL is present in stdout');
6058
});
6159

62-
QUnit.test('when the terminal is not a TTY return only the URL', async function(assert) {
60+
QUnit.test('when the terminal is not a TTY return only the URL', async function (assert) {
6361
let file = tmp.fileSync();
6462
await execa(EXECUTABLE_PATH, ['canary'], { stdout: file.fd });
6563
assert.equal(
@@ -69,7 +67,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
6967
);
7068
});
7169

72-
QUnit.test('updates local package.json when -w is passed (dependencies)', async function(
70+
QUnit.test('updates local package.json when -w is passed (dependencies)', async function (
7371
assert
7472
) {
7573
fs.writeFileSync(
@@ -87,7 +85,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
8785
});
8886
});
8987

90-
QUnit.test('updates local package.json when --write is passed (dependencies)', async function(
88+
QUnit.test('updates local package.json when --write is passed (dependencies)', async function (
9189
assert
9290
) {
9391
fs.writeFileSync(
@@ -107,7 +105,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
107105

108106
QUnit.test(
109107
'updates local package.json when --write is passed (devDependencies)',
110-
async function(assert) {
108+
async function (assert) {
111109
fs.writeFileSync(
112110
'package.json',
113111
JSON.stringify({ devDependencies: { 'ember-source': '^3.10.0' } }),
@@ -124,7 +122,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
124122
}
125123
);
126124

127-
QUnit.test('preserves line ending when updating package.json', async function(assert) {
125+
QUnit.test('preserves line ending when updating package.json', async function (assert) {
128126
fs.writeFileSync(
129127
'package.json',
130128
JSON.stringify({ dependencies: { 'ember-source': '^3.10.0' } }, null, 2) + '\n',
@@ -138,7 +136,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
138136
assert.deepEqual(fs.readFileSync('package.json', { encoding: 'utf8' }), expected);
139137
});
140138

141-
QUnit.test('fails when package.json is missing', async function(assert) {
139+
QUnit.test('fails when package.json is missing', async function (assert) {
142140
try {
143141
await execa(EXECUTABLE_PATH, ['canary', '--write']);
144142
} catch (results) {
@@ -150,7 +148,7 @@ QUnit.module('ember-source-channel-url', function(hooks) {
150148
}
151149
});
152150

153-
QUnit.test('fails when ember-source is not a dep', async function(assert) {
151+
QUnit.test('fails when ember-source is not a dep', async function (assert) {
154152
fs.writeFileSync('package.json', JSON.stringify({}), {
155153
encoding: 'utf8',
156154
});

0 commit comments

Comments
 (0)