Skip to content

Commit

Permalink
Bump XO and minor style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 1, 2017
1 parent 9da7391 commit e296e52
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"proxyquire": "^1.0.0",
"sinon": "^2.1.0",
"tui-jsdoc-template": "^1.0.4",
"xo": "^0.17.0",
"xo": "^0.18.1",
"yeoman-assert": "^3.0.0",
"yeoman-test": "^1.0.0"
},
Expand Down
22 changes: 11 additions & 11 deletions test/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('Base', () => {
it('can emit error from sync methods', function (done) {
const error = new Error();

this.TestGenerator.prototype.throwing = function () {
this.TestGenerator.prototype.throwing = () => {
throw error;
};

Expand All @@ -270,7 +270,7 @@ describe('Base', () => {
const error = new Error();
const spy = sinon.spy();

this.TestGenerator.prototype.throwing = function () {
this.TestGenerator.prototype.throwing = () => {
throw error;
};
this.TestGenerator.prototype.afterError = spy;
Expand All @@ -286,7 +286,7 @@ describe('Base', () => {
const spy1 = sinon.spy();
const spy2 = sinon.spy();

this.TestGenerator.prototype.first = function () {
this.TestGenerator.prototype.first = () => {
return new Promise(resolve => {
setTimeout(() => {
spy1();
Expand All @@ -295,7 +295,7 @@ describe('Base', () => {
});
};

this.TestGenerator.prototype.second = function () {
this.TestGenerator.prototype.second = () => {
spy2();
};

Expand All @@ -306,14 +306,14 @@ describe('Base', () => {
});

it('handle failing promises as errors', function (done) {
this.TestGenerator.prototype.failing = function () {
this.TestGenerator.prototype.failing = () => {
return new Promise((resolve, reject) => {
reject('some error');
reject(new Error('some error'));
});
};

this.testGen.on('error', err => {
assert.equal(err, 'some error');
assert.equal(err.message, 'some error');
done();
});

Expand All @@ -335,7 +335,7 @@ describe('Base', () => {
}, 10);
};

this.TestGenerator.prototype.async2 = function () {
this.TestGenerator.prototype.async2 = () => {
assert(!async1Running);
assert(async1Ran);
done();
Expand Down Expand Up @@ -676,7 +676,7 @@ describe('Base', () => {
env: this.env,
resolved: 'test'
});
const addWrongOp = function () {
const addWrongOp = () => {
generator.option('no-op');
};
assert.throws(addWrongOp, /this\.option\('op', \{type: Boolean\}\)/);
Expand Down Expand Up @@ -1003,8 +1003,8 @@ describe('Base', () => {
class Generator extends Base {}
this.Generator = Generator;
Generator.namespace = 'angular:app';
Generator.prototype.createSomething = function () {};
Generator.prototype.createSomethingElse = function () {};
Generator.prototype.createSomething = () => {};
Generator.prototype.createSomethingElse = () => {};
});

it('emits the series of event on a specific generator', function (done) {
Expand Down
4 changes: 2 additions & 2 deletions test/conflicter.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('Conflicter', () => {
const _prompt = testAdapter.prompt.bind(testAdapter);
const promptStub = sinon.stub(testAdapter, 'prompt', (prompts, resultHandler) => {
if (promptStub.calledTwice) {
const stubbedResultHandler = function (result) {
const stubbedResultHandler = result => {
result.action = 'write';
return resultHandler(result);
};
Expand All @@ -161,7 +161,7 @@ describe('Conflicter', () => {
const _prompt = testAdapter.prompt.bind(testAdapter);
const promptStub = sinon.stub(testAdapter, 'prompt', (prompts, resultHandler) => {
if (promptStub.calledTwice) {
const stubbedResultHandler = function (result) {
const stubbedResultHandler = result => {
result.action = 'write';
return resultHandler(result);
};
Expand Down

0 comments on commit e296e52

Please sign in to comment.