Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Update eslint to the latest version 🚀 (#222)
Browse files Browse the repository at this point in the history
* chore(package): update eslint to version 4.0.0

* Fixes for ESLint 4.0

* Remove Yarn to go back to latest NPM

* Add new yarn.lock
  • Loading branch information
greenkeeper[bot] authored and daffl committed Jun 16, 2017
1 parent 3baa902 commit 3f69576
Show file tree
Hide file tree
Showing 4 changed files with 822 additions and 773 deletions.
5 changes: 3 additions & 2 deletions generators/service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const j = require('../../lib/transform');

const templatePath = path.join(__dirname, 'templates');
const stripSlashes = name => name.replace(/^(\/*)|(\/*)$/g, '');
const createExpression = (object, property, args = []) =>
j.expressionStatement(j.callExpression(j.memberExpression(j.identifier(object), j.identifier(property)), args));
const createExpression = (object, property, args = []) => {
return j.expressionStatement(j.callExpression(j.memberExpression(j.identifier(object), j.identifier(property)), args));
};

module.exports = class ServiceGenerator extends Generator {
prompting() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"body-parser": "^1.17.2",
"compression": "^1.6.2",
"cors": "^2.8.3",
"eslint": "^3.13.1",
"eslint": "^4.0.0",
"feathers": "^2.1.3",
"feathers-configuration": "^0.4.1",
"feathers-errors": "^2.8.1",
Expand Down
75 changes: 30 additions & 45 deletions test/generators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ describe('generator-feathers', function() {
return runConnectionGenerator({
database: 'nedb',
connectionString: 'nedb://../mytest'
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'),
{ nedb: '../mytest' }
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});

describe('mongodb', () => {
Expand All @@ -114,14 +112,12 @@ describe('generator-feathers', function() {
database: 'mongodb',
adapter: 'mongodb',
connectionString
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'),
{ mongodb: connectionString }
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});

it('mongoose', () => {
Expand All @@ -131,14 +127,12 @@ describe('generator-feathers', function() {
database: 'mongodb',
adapter: 'mongoose',
connectionString
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'),
{ mongodb: connectionString }
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});
});

Expand Down Expand Up @@ -166,8 +160,7 @@ describe('generator-feathers', function() {
database: 'sqlite',
adapter: 'knex',
connectionString
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'), {
sqlite: {
Expand All @@ -178,8 +171,7 @@ describe('generator-feathers', function() {
}
}
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});

it('sequelize', () => {
Expand All @@ -189,24 +181,21 @@ describe('generator-feathers', function() {
database: 'sqlite',
adapter: 'sequelize',
connectionString
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'), {
sqlite: connectionString
}
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});
});

it('rethinkdb', () => {
return runConnectionGenerator({
database: 'rethinkdb',
connectionString: 'rethinkdb://localhost:11078/testing'
})
.then(() =>
}).then(() =>
assert.jsonFileContent(
path.join(appDir, 'config', 'default.json'), {
rethinkdb: {
Expand All @@ -220,8 +209,7 @@ describe('generator-feathers', function() {
}
}
)
)
.then(() => runTest('starts and shows the index page'));
).then(() => runTest('starts and shows the index page'));
});
});

Expand All @@ -247,21 +235,19 @@ describe('generator-feathers', function() {
method: 'post',
json: true,
body: { text }
})
.then(response => {
}).then(response => {
if(id) {
assert.ok(typeof response[id] !== 'undefined');
}

assert.equal(response.text, text);
})
.then(() => child.kill())
.catch(e =>
new Promise((resolve, reject) => {
child.once('exit', () => reject(e));
child.kill('SIGKILL');
})
);
}).then(() => child.kill())
.catch(e =>
new Promise((resolve, reject) => {
child.once('exit', () => reject(e));
child.kill('SIGKILL');
})
);
});
}

Expand All @@ -277,17 +263,16 @@ describe('generator-feathers', function() {

describe('feathers:authentication', () => {
it.skip('runs and initializes working local strategy', () => {
return helpers.run(path.join(__dirname, '../generators/authentication'))
.withPrompts({
strategies: ['local'],
entity: 'users',
database: 'memory'
})
.withOptions({ skipInstall: false })
.then(() => startAndWait('node', ['src/'], { cwd: appDir }, 'Feathers application started'))
.then(delay(1000));
// .then(({ child }) => {
// });
return helpers
.run(path.join(__dirname, '../generators/authentication'))
.withPrompts({
strategies: ['local'],
entity: 'users',
database: 'memory'
})
.withOptions({ skipInstall: false })
.then(() => startAndWait('node', ['src/'], { cwd: appDir }, 'Feathers application started'))
.then(delay(1000));
});
});
});
Loading

0 comments on commit 3f69576

Please sign in to comment.