Skip to content

Commit 6105c85

Browse files
committed
code clean up
1 parent f89a1f2 commit 6105c85

8 files changed

Lines changed: 19 additions & 16 deletions

File tree

test-packages/basic-app/test/server-assets-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
const RSVP = require('rsvp');
44
const request = RSVP.denodeify(require('request'));
55
const expect = require('chai').use(require('chai-string')).expect;
6-
const { startServer, stopServer } = require('../../test-libs/index');
6+
const { startServer, stopServer } = require('../../test-libs');
77

8-
describe.only('serve assets acceptance', function() {
8+
describe('serve assets acceptance', function() {
99
this.timeout(20000);
1010

1111
before(function() {

test-packages/basic-app/test/shoebox-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const RSVP = require('rsvp');
44
const request = RSVP.denodeify(require('request'));
55
const expect = require('chai').use(require('chai-string')).expect;
6-
const { startServer, stopServer } = require('../../test-libs/index');
6+
const { startServer, stopServer } = require('../../test-libs');
77

88
describe('shoebox - put', function() {
99
this.timeout(20000);

test-packages/basic-app/test/simple-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const RSVP = require('rsvp');
44
const request = RSVP.denodeify(require('request'));
55
const expect = require('chai').use(require('chai-string')).expect;
6-
const { startServer, stopServer } = require('../../test-libs/index');
6+
const { startServer, stopServer } = require('../../test-libs');
77

88
describe('simple acceptance', function() {
99
this.timeout(30000);

test-packages/test-libs/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ const killCliProcess = require('./kill-cli-process');
66
let server;
77
let longRunningServerPromise;
88

9-
const startServer = function(options) {
10-
return runServer(options)
11-
.then(result => {
12-
server = result.server;
13-
longRunningServerPromise = result.longRunningServerPromise;
14-
});
9+
const startServer = async (options) => {
10+
const result = await runServer(options);
11+
12+
server = result.server;
13+
longRunningServerPromise = result.longRunningServerPromise;
14+
15+
return result;
1516
};
1617

17-
const stopServer = function() {
18+
const stopServer = () => {
1819
if (!server) {
1920
throw new Error('You must call `startServer()` before calling `stopServer()`.');
2021
}

test-packages/test-libs/kill-cli-process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
module.exports = function(childProcess) {
3+
module.exports = childProcess => {
44
if (process.platform === 'win32') {
55
childProcess.send({ kill: true });
66
} else {

test-packages/test-libs/run-command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const exec = denodeify(childProcess.exec);
1212

1313
const isWindows = process.platform === 'win32';
1414

15-
module.exports = function run(/* command, args, options */) {
15+
module.exports = function run() {
1616
let command = arguments[0];
1717
let args = Array.prototype.slice.call(arguments, 1);
1818
let options = {};
@@ -21,7 +21,7 @@ module.exports = function run(/* command, args, options */) {
2121
options = args.pop();
2222
}
2323

24-
debug('running command=' + command + '; args=' + args + '; cwd=' + process.cwd());
24+
debug(`running command=${command} args=${args}`);
2525

2626
if (isWindows && (command === 'npm' || command === 'bower')) {
2727
return exec(command + ' ' + args.join(' '));

test-packages/test-libs/run-ember.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const findup = require('findup-sync');
55
const runCommand = require('./run-command');
66

7-
module.exports = function(command, options) {
7+
module.exports = (command, options) => {
88
let emberCLIPath = findup('node_modules/ember-cli');
99

1010
let args = [path.join(emberCLIPath, 'bin', 'ember'), command].concat(options);

test-packages/test-libs/run-server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const debug = require('./debug');
44
const runEmber = require('./run-ember');
55
const defaults = require('lodash/defaults');
66

7-
module.exports = function runServer(options) {
7+
const runServer = options => {
88
return new Promise((resolve, reject) => {
99
options = options || { };
1010

@@ -49,6 +49,8 @@ module.exports = function runServer(options) {
4949
});
5050
};
5151

52+
module.exports = runServer;
53+
5254
function detectServerStart(output) {
5355
let indicators = [
5456
'Ember FastBoot running at',

0 commit comments

Comments
 (0)