Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Chore: Fix prefer-arrow-callback lint errors (#7651)
  • Loading branch information
platinumazure authored and ilyavolodin committed Nov 24, 2016
1 parent 89bd8de commit eadd808
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/lib/ast-utils.js
Expand Up @@ -667,7 +667,7 @@ describe("ast-utils", () => {
});
});

describe("getFunctionNameWithKind", function() {
describe("getFunctionNameWithKind", () => {
const expectedResults = {
"function foo() {}": "function 'foo'",
"(function foo() {})": "function 'foo'",
Expand Down Expand Up @@ -714,7 +714,7 @@ describe("ast-utils", () => {
};

Object.keys(expectedResults).forEach(key => {
it(`should return "${expectedResults[key]}" for "${key}".`, function() {
it(`should return "${expectedResults[key]}" for "${key}".`, () => {
let called = false;

/**
Expand All @@ -740,7 +740,7 @@ describe("ast-utils", () => {
});
});

describe("getFunctionHeadLoc", function() {
describe("getFunctionHeadLoc", () => {
const expectedResults = {
"function foo() {}": [0, 12],
"(function foo() {})": [1, 13],
Expand Down Expand Up @@ -798,7 +798,7 @@ describe("ast-utils", () => {
}
};

it(`should return "${JSON.stringify(expectedLoc)}" for "${key}".`, function() {
it(`should return "${JSON.stringify(expectedLoc)}" for "${key}".`, () => {
let called = false;

/**
Expand All @@ -824,23 +824,23 @@ describe("ast-utils", () => {
});
});

describe("isEmptyBlock", function() {
describe("isEmptyBlock", () => {
const expectedResults = {
"{}": true,
"{ a }": false,
a: false,
};

Object.keys(expectedResults).forEach(key => {
it(`should return ${expectedResults[key]} for ${key}`, function() {
it(`should return ${expectedResults[key]} for ${key}`, () => {
const ast = espree.parse(key);

assert.strictEqual(astUtils.isEmptyBlock(ast.body[0]), expectedResults[key]);
});
});
});

describe("isEmptyFunction", function() {
describe("isEmptyFunction", () => {
const expectedResults = {
"(function foo() {})": true,
"(function foo() { a })": false,
Expand All @@ -850,7 +850,7 @@ describe("ast-utils", () => {
};

Object.keys(expectedResults).forEach(key => {
it(`should return ${expectedResults[key]} for ${key}`, function() {
it(`should return ${expectedResults[key]} for ${key}`, () => {
const ast = espree.parse(key, {ecmaVersion: 6});

assert.strictEqual(astUtils.isEmptyFunction(ast.body[0].expression), expectedResults[key]);
Expand Down

0 comments on commit eadd808

Please sign in to comment.