Skip to content

Commit b9834fd

Browse files
committed
fix more prettier errors
1 parent ee411a1 commit b9834fd

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

packages/fastboot-express-middleware/src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function fastbootExpressMiddleware(distPath, options) {
1313

1414
opts = opts || {};
1515

16-
let log = opts.log !== false ? _log : function() {};
16+
let log = opts.log !== false ? _log : function () {};
1717

1818
let fastboot = opts.fastboot;
1919

@@ -25,7 +25,7 @@ function fastbootExpressMiddleware(distPath, options) {
2525
});
2626
}
2727

28-
return async function(req, res, next) {
28+
return async function (req, res, next) {
2929
let path = req.url;
3030

3131
try {
@@ -53,7 +53,7 @@ function fastbootExpressMiddleware(distPath, options) {
5353
} else if (result.error) {
5454
res.send(body[0]);
5555
} else {
56-
body.forEach(chunk => res.write(chunk));
56+
body.forEach((chunk) => res.write(chunk));
5757
res.end();
5858
}
5959
} catch (error) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var path = require('path');
22

3-
module.exports = function(fixturePath) {
3+
module.exports = function (fixturePath) {
44
return path.join(__dirname, '../fixtures/', fixturePath);
55
};

packages/fastboot-express-middleware/test/helpers/test-http-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class TestHTTPServer {
3535
});
3636
}
3737

38-
return new Promise(resolve => {
38+
return new Promise((resolve) => {
3939
let port = options.port || 3000;
4040
let host = options.host || 'localhost';
4141

packages/fastboot-express-middleware/test/middleware-test.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ const fastbootMiddleware = require('./../src/index');
66
const fixture = require('./helpers/fixture-path');
77
const TestHTTPServer = require('./helpers/test-http-server');
88

9-
describe('FastBoot', function() {
9+
describe('FastBoot', function () {
1010
let server;
1111

1212
this.timeout(10000);
1313

14-
afterEach(function() {
14+
afterEach(function () {
1515
if (server) {
1616
server.stop();
1717
server = null;
1818
}
1919
});
2020

21-
it('throws an exception if no distPath is provided', function() {
22-
let fn = function() {
21+
it('throws an exception if no distPath is provided', function () {
22+
let fn = function () {
2323
fastbootMiddleware();
2424
};
2525

2626
expect(fn).to.throw(/You must instantiate FastBoot with a distPath option/);
2727
});
2828

29-
it('can provide distPath as the first argument', async function() {
29+
it('can provide distPath as the first argument', async function () {
3030
let middleware = fastbootMiddleware(fixture('basic-app'));
3131
server = new TestHTTPServer(middleware);
3232
await server.start();
@@ -35,7 +35,7 @@ describe('FastBoot', function() {
3535
expect(html).to.match(/Welcome to Ember/);
3636
});
3737

38-
it('can provide distPath as an option', async function() {
38+
it('can provide distPath as an option', async function () {
3939
let middleware = fastbootMiddleware({
4040
distPath: fixture('basic-app'),
4141
});
@@ -46,7 +46,7 @@ describe('FastBoot', function() {
4646
expect(html).to.match(/Welcome to Ember/);
4747
});
4848

49-
it('can be provided with a custom FastBoot instance', async function() {
49+
it('can be provided with a custom FastBoot instance', async function () {
5050
let fastboot = new FastBoot({
5151
distPath: fixture('basic-app'),
5252
});
@@ -62,7 +62,7 @@ describe('FastBoot', function() {
6262
expect(html).to.match(/Welcome to Ember/);
6363
});
6464

65-
it('can reload the FastBoot instance', async function() {
65+
it('can reload the FastBoot instance', async function () {
6666
let fastboot = new FastBoot({
6767
distPath: fixture('basic-app'),
6868
});
@@ -85,7 +85,7 @@ describe('FastBoot', function() {
8585
expect(html).to.match(/Goodbye from Ember/);
8686
});
8787

88-
it('it appends multivalue headers', async function() {
88+
it('it appends multivalue headers', async function () {
8989
let middleware = fastbootMiddleware(fixture('multivalue-headers'));
9090
server = new TestHTTPServer(middleware);
9191
await server.start();
@@ -94,7 +94,7 @@ describe('FastBoot', function() {
9494
expect(headers['x-fastboot']).to.eq('a, b, c');
9595
});
9696

97-
it('can pass metadata info to the app', async function() {
97+
it('can pass metadata info to the app', async function () {
9898
let middleware = fastbootMiddleware({
9999
distPath: fixture('app-with-metadata'),
100100
visitOptions: {
@@ -111,7 +111,7 @@ describe('FastBoot', function() {
111111
// FIXME:
112112
// TODO:
113113
// https://github.com/ember-fastboot/ember-cli-fastboot/pull/840#issuecomment-894329631
114-
it.skip('works without metadata passed', async function() {
114+
it('works without metadata passed', async function () {
115115
let middleware = fastbootMiddleware({
116116
distPath: fixture('app-with-metadata'),
117117
});
@@ -123,10 +123,10 @@ describe('FastBoot', function() {
123123
});
124124

125125
/* eslint-disable mocha/no-setup-in-describe */
126-
[true, false].forEach(chunkedResponse => {
127-
describe(`when chunked response is ${chunkedResponse ? 'enabled' : 'disabled'}`, function() {
126+
[true, false].forEach((chunkedResponse) => {
127+
describe(`when chunked response is ${chunkedResponse ? 'enabled' : 'disabled'}`, function () {
128128
if (chunkedResponse) {
129-
it('responds with a chunked response', async function() {
129+
it('responds with a chunked response', async function () {
130130
let middleware = fastbootMiddleware({
131131
distPath: fixture('basic-app'),
132132
chunkedResponse,
@@ -140,7 +140,7 @@ describe('FastBoot', function() {
140140
});
141141
}
142142

143-
it("returns 404 when navigating to a URL that doesn't exist", async function() {
143+
it("returns 404 when navigating to a URL that doesn't exist", async function () {
144144
let middleware = fastbootMiddleware({
145145
distPath: fixture('basic-app'),
146146
chunkedResponse,
@@ -155,7 +155,7 @@ describe('FastBoot', function() {
155155
}
156156
});
157157

158-
it('returns a 500 error if an error occurs', async function() {
158+
it('returns a 500 error if an error occurs', async function () {
159159
let middleware = fastbootMiddleware({
160160
distPath: fixture('rejected-promise'),
161161
chunkedResponse,
@@ -170,8 +170,8 @@ describe('FastBoot', function() {
170170
}
171171
});
172172

173-
describe('when resilient mode is enabled', function() {
174-
it('renders no FastBoot markup', async function() {
173+
describe('when resilient mode is enabled', function () {
174+
it('renders no FastBoot markup', async function () {
175175
let middleware = fastbootMiddleware({
176176
distPath: fixture('rejected-promise'),
177177
resilient: true,
@@ -184,7 +184,7 @@ describe('FastBoot', function() {
184184
expect(html).to.not.match(/error/);
185185
});
186186

187-
it('propagates to error handling middleware', async function() {
187+
it('propagates to error handling middleware', async function () {
188188
let middleware = fastbootMiddleware({
189189
distPath: fixture('rejected-promise'),
190190
resilient: true,
@@ -201,7 +201,7 @@ describe('FastBoot', function() {
201201
expect(body).to.match(/hello world/);
202202
});
203203

204-
it('is does not propagate errors when and there is no error handling middleware', async function() {
204+
it('is does not propagate errors when and there is no error handling middleware', async function () {
205205
let middleware = fastbootMiddleware({
206206
distPath: fixture('rejected-promise'),
207207
resilient: true,
@@ -219,7 +219,7 @@ describe('FastBoot', function() {
219219
expect(body).to.match(/hello world/);
220220
});
221221

222-
it('allows post-fastboot middleware to recover the response when it fails', async function() {
222+
it('allows post-fastboot middleware to recover the response when it fails', async function () {
223223
let middleware = fastbootMiddleware({
224224
distPath: fixture('rejected-promise'),
225225
resilient: true,
@@ -237,8 +237,8 @@ describe('FastBoot', function() {
237237
});
238238
});
239239

240-
describe('when resilient mode is disabled', function() {
241-
it('propagates to error handling middleware', async function() {
240+
describe('when resilient mode is disabled', function () {
241+
it('propagates to error handling middleware', async function () {
242242
let middleware = fastbootMiddleware({
243243
distPath: fixture('rejected-promise'),
244244
resilient: false,
@@ -257,7 +257,7 @@ describe('FastBoot', function() {
257257
}
258258
});
259259

260-
it('allows post-fastboot middleware to recover the response when it fails', async function() {
260+
it('allows post-fastboot middleware to recover the response when it fails', async function () {
261261
let middleware = fastbootMiddleware({
262262
distPath: fixture('rejected-promise'),
263263
resilient: false,

0 commit comments

Comments
 (0)