From 863de6542033cf1ec4c05a2af1e89f25cc4c96b4 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Sat, 17 Sep 2016 00:19:42 +0200 Subject: [PATCH 1/2] Fix #564: Fix tests not running due to Espree bump --- tests/src/rules/export.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/src/rules/export.js b/tests/src/rules/export.js index 97714dc5f..04c77eb50 100644 --- a/tests/src/rules/export.js +++ b/tests/src/rules/export.js @@ -2,7 +2,9 @@ import { test, SYNTAX_CASES } from '../utils' import { RuleTester } from 'eslint' -var ruleTester = new RuleTester() +var ruleTester = new RuleTester({ + parser: 'babel-eslint' +}) , rule = require('rules/export') ruleTester.run('export', rule, { @@ -71,13 +73,13 @@ ruleTester.run('export', rule, { // '\'./default-export\'.' // , type: 'Literal' }] }), - test({ - code: 'export * from "./malformed.js"', - errors: [{ - message: "Parse errors in imported module './malformed.js': 'return' outside of function (1:1)", - type: 'Literal', - }], - }), + // test({ + // code: 'export * from "./malformed.js"', + // errors: [{ + // message: "Parse errors in imported module './malformed.js': 'return' outside of function (1:1)", + // type: 'Literal', + // }], + // }), test({ code: 'export var { foo, bar } = object; export var foo = "bar"', From a1386ee62b55da075ba8c4c0be883ac81d05f3e3 Mon Sep 17 00:00:00 2001 From: Ben Mosher Date: Sat, 17 Sep 2016 16:24:11 -0400 Subject: [PATCH 2/2] updated malformed test also, the most trivial of line formatting changes --- tests/src/rules/export.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/src/rules/export.js b/tests/src/rules/export.js index 04c77eb50..91e3a000b 100644 --- a/tests/src/rules/export.js +++ b/tests/src/rules/export.js @@ -2,9 +2,7 @@ import { test, SYNTAX_CASES } from '../utils' import { RuleTester } from 'eslint' -var ruleTester = new RuleTester({ - parser: 'babel-eslint' -}) +var ruleTester = new RuleTester({ parser: 'babel-eslint' }) , rule = require('rules/export') ruleTester.run('export', rule, { @@ -73,13 +71,15 @@ ruleTester.run('export', rule, { // '\'./default-export\'.' // , type: 'Literal' }] }), - // test({ - // code: 'export * from "./malformed.js"', - // errors: [{ - // message: "Parse errors in imported module './malformed.js': 'return' outside of function (1:1)", - // type: 'Literal', - // }], - // }), + // note: Espree bump to Acorn 4+ changed this test's error message. + // `npm up` first if it's failing. + test({ + code: 'export * from "./malformed.js"', + errors: [{ + message: "Parse errors in imported module './malformed.js': Line 1: Unexpected token (1:12)", + type: 'Literal', + }], + }), test({ code: 'export var { foo, bar } = object; export var foo = "bar"',