From 9857420ce2cc6142a8898ca7967ff50611834810 Mon Sep 17 00:00:00 2001 From: pri1311 Date: Tue, 29 Mar 2022 22:32:18 +0530 Subject: [PATCH] add test --- tests/src/rules/newline-after-import.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/src/rules/newline-after-import.js b/tests/src/rules/newline-after-import.js index dc0d3d4059..bf91064f85 100644 --- a/tests/src/rules/newline-after-import.js +++ b/tests/src/rules/newline-after-import.js @@ -321,20 +321,31 @@ ruleTester.run('newline-after-import', require('rules/newline-after-import'), { `, parserOptions: { ecmaVersion: 2015, sourceType: 'module' } , }, + ), + + invalid: [].concat( { code: ` import { A, B, C, D } from '../path/to/my/module/in/very/far/directory' - // some comment var foo = 'bar'; `, + output: ` + import { A, B, C, D } from + '../path/to/my/module/in/very/far/directory' + + // some comment + var foo = 'bar'; + `, + errors: [ { + line: 3, + column: 1, + message: IMPORT_ERROR_MESSAGE, + } ], parserOptions: { ecmaVersion: 2015, sourceType: 'module' }, options: [{ 'considerComments': true }], }, - ), - - invalid: [].concat( { code: ` import path from 'path';