Skip to content

Commit

Permalink
fixes more syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smulesoft committed May 16, 2017
1 parent 31def8d commit d1d5e33
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions test/docker/docker.js
@@ -1,5 +1,5 @@
const _ = require('lodash');
const $Docker = require('dockerode');
var _ = require('lodash');
var $Docker = require('dockerode');

function Docker() {
this.dockerAPI = new $Docker({ socketPath: '/var/run/docker.sock' });
Expand Down
12 changes: 6 additions & 6 deletions test/docker/dockerContainer.js
@@ -1,6 +1,6 @@
'use strict';

const Promise = require('bluebird');
var Promise = require('bluebird');

function DockerContainer(docker, name, image, options) {
this.container = docker.createContainer(name, image, options);
Expand All @@ -10,10 +10,10 @@ function DockerContainer(docker, name, image, options) {
* @returns {Promise}
*/
DockerContainer.prototype.start = function () {
const self = this;
var self = this;
return self.container.then(function (c) {
return c.start().then(function () {
console.log(`#~ Started container ${c.id}`);
console.log('#~ Started container', c.id);
return self.waitReady();
})
})
Expand All @@ -32,7 +32,7 @@ DockerContainer.prototype.waitReady = function () {
DockerContainer.prototype.stop = function () {
return this.container.then(function (c) {
return c.stop().then(function () {
console.log(`#~ Stopped container ${c.id}`);
console.log('#~ Stopped container', c.id);
})
.catch(function (err) {
if (err.statusCode !== 304) {
Expand All @@ -46,11 +46,11 @@ DockerContainer.prototype.stop = function () {
* @returns {Promise}
*/
DockerContainer.prototype.destroy = function () {
const self = this;
var self = this;
return self.stop().then(function () {
return self.container.then(function (c) {
return c.remove().then(function () {
console.log(`#~ Removed container ${c.id}`);
console.log('#~ Removed container', c.id);
});
});
});
Expand Down
8 changes: 4 additions & 4 deletions test/docker/index.js
Expand Up @@ -4,14 +4,14 @@ var os = require('os');
var proc = require('child_process')
var config = require('../knexfile');
var knex = require('../../knex');
var Promise = require('bluebird');

if (canRunDockerTests()) {
Promise.each(Object.keys(config), function(dialectName) {
var dialectName;
for (dialectName in config) {
if (config[dialectName].docker) {
return require('./reconnect')(config[dialectName], knex);
require('./reconnect')(config[dialectName], knex);
}
});
}
}

function canRunDockerTests() {
Expand Down
12 changes: 6 additions & 6 deletions test/docker/mysql/index.js
@@ -1,8 +1,8 @@
'use strict';

const Promise = require('bluebird');
const _ = require('lodash');
const DockerContainer = require('../dockerContainer');
var Promise = require('bluebird');
var _ = require('lodash');
var DockerContainer = require('../dockerContainer');

function MySQLContainer(docker, options) {
var name = _.get(options, 'container');
Expand All @@ -11,10 +11,10 @@ function MySQLContainer(docker, options) {
var password = _.get(options, 'password');
var hostPort = _.get(options, 'hostPort');
DockerContainer.call(this, docker, name, image, {
Env: [ `MYSQL_ROOT_PASSWORD=root` ],
Env: [ 'MYSQL_ROOT_PASSWORD=root' ],
PortBindings: {
'3306/tcp': [{
HostPort: `${hostPort}`
HostPort: hostPort.toStrig()
}]
}
});
Expand All @@ -26,7 +26,7 @@ MySQLContainer.prototype = Object.create(DockerContainer.prototype);
* @returns {Promise}
*/
MySQLContainer.prototype.waitReady = function () {
const self = this;
var self = this;
return self.container.then(function (c) {
return new Promise(function (resolve) {
c.exec({
Expand Down
12 changes: 6 additions & 6 deletions test/docker/postgres/index.js
@@ -1,8 +1,8 @@
'use strict';

const Promise = require('bluebird');
const _ = require('lodash');
const DockerContainer = require('../dockerContainer');
var Promise = require('bluebird');
var _ = require('lodash');
var DockerContainer = require('../dockerContainer');

function PostgresContainer(docker, options) {
var name = _.get(options, 'container');
Expand All @@ -11,10 +11,10 @@ function PostgresContainer(docker, options) {
var password = _.get(options, 'password');
var hostPort = _.get(options, 'hostPort');
DockerContainer.call(this, docker, name, image, {
Env: [`POSTGRES_USER=${username}`, `POSTGRES_PASSWORD=${password}`],
Env: ['POSTGRES_USER=' + username, 'POSTGRES_PASSWORD=' + password],
PortBindings: {
'5432/tcp': [{
HostPort: `${hostPort}`
HostPort: hostPort.toString()
}]
}
});
Expand All @@ -26,7 +26,7 @@ PostgresContainer.prototype = Object.create(DockerContainer.prototype);
* @returns {Promise}
*/
PostgresContainer.prototype.waitReady = function () {
const self = this;
var self = this;
return self.container.then(function (c) {
return new Promise(function (resolve) {
c.exec({
Expand Down
8 changes: 4 additions & 4 deletions test/docker/reconnect.js
Expand Up @@ -96,16 +96,16 @@ module.exports = function(config, knex) {
});

function testQuery(pool) {
return pool.raw(`SELECT 10 as ten`).then(function (result) {
return pool.raw('SELECT 10 as ten').then(function (result) {
expect(result.rows || result[0]).to.deep.equal([{ ten: 10 }]);
});
}

function sequencedPromise(blocks) {
const order = function (prev, block) {
var order = function (prev, block) {
return prev.then(block)
};
const base = Promise.resolve(true);
var base = Promise.resolve(true);
return blocks.reduce(order, base);
}

Expand Down Expand Up @@ -133,7 +133,7 @@ module.exports = function(config, knex) {

function waitReadyForQueries(attempt = 0) {
return new Promise(function (resolve, reject) {
console.log(`#~ Waiting to be ready for queries #${attempt}`);
console.log('#~ Waiting to be ready for queries #', attempt);
var pool = createPool();
pool.raw('SELECT 1 as one')
.then(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Expand Up @@ -47,4 +47,4 @@ if (config.oracledb) {
describe('Docker Integration Tests', function() {
this.timeout(process.env.KNEX_TEST_TIMEOUT || 15000);
require('./docker')
})
})

0 comments on commit d1d5e33

Please sign in to comment.