Skip to content

Commit 21990e4

Browse files
committed
AC-1156: Move custom eslint tests to magento-coding-standard repo
- Refactor: Build relative path inside abstract class instead of __DIR__
1 parent 2b5e993 commit 21990e4

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

Magento2/Tests/Eslint/AbstractEslintTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class AbstractEslintTestCase extends TestCase
1212
protected function assertFileContainsError(string $testFile, array $expectedMessages)
1313
{
1414
exec(
15-
'npm run eslint -- ' . $testFile,
15+
'npm run eslint -- Magento2/Tests/Eslint/' . $testFile,
1616
$output
1717
);
1818

Magento2/Tests/Eslint/AndSelfTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class AndSelfTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/AndSelfTest.js',
13+
'AndSelfTest.js',
1414
['jQuery.andSelf() removed, use jQuery.addBack()']
1515
);
1616
}

Magento2/Tests/Eslint/BindUnbindTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BindUnbindTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/BindUnbindTest.js',
13+
'BindUnbindTest.js',
1414
['jQuery $.bind and $.unbind are deprecated, use $.on and $.off instead']
1515
);
1616
}

Magento2/Tests/Eslint/ClickEventShorthandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ClickEventShorthandTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/ClickEventShorthand.js',
13+
'ClickEventShorthand.js',
1414
['Instead of .blur(fn) use .on("blur", fn). Instead of .blur() use .trigger("blur")']
1515
);
1616
}

Magento2/Tests/Eslint/DelegateUndelegateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class DelegateUndelegateTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/DelegateUndelegateTest.js',
13+
'DelegateUndelegateTest.js',
1414
['jQuery $.delegate and $.undelegate are deprecated, use $.on and $.off instead']
1515
);
1616
}

Magento2/Tests/Eslint/EventShorthandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class EventShorthandTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/EventShorthandTest.js',
13+
'EventShorthandTest.js',
1414
['jQuery.load() was removed, use .on("load", fn) instead']
1515
);
1616
}

Magento2/Tests/Eslint/SizeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SizeTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/SizeTest.js',
13+
'SizeTest.js',
1414
['jQuery.size() removed, use jQuery.length']
1515
);
1616
}

Magento2/Tests/Eslint/TrimTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TrimTest extends AbstractEslintTestCase
1010
public function testExecute()
1111
{
1212
$this->assertFileContainsError(
13-
__DIR__ . '/TrimTest.js',
13+
'TrimTest.js',
1414
['jQuery.trim is deprecated; use String.prototype.trim']
1515
);
1616
}

0 commit comments

Comments
 (0)