Skip to content

Commit 02b640a

Browse files
committed
Skip test when NPM is not installed
1 parent 49e2e23 commit 02b640a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Magento2/Tests/Eslint/AbstractEslintTestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento2\Tests\Eslint;
99

10+
use PHP_CodeSniffer\Config;
1011
use PHPUnit\Framework\TestCase;
1112

1213
/**
@@ -24,6 +25,10 @@ abstract class AbstractEslintTestCase extends TestCase
2425
*/
2526
protected function assertFileContainsError(string $testFile, array $expectedMessages): void
2627
{
28+
if (Config::getExecutablePath('npm') === null) {
29+
$this->markTestSkipped('npm is not installed here');
30+
}
31+
2732
// phpcs:ignore Magento2.Security.InsecureFunction.FoundWithAlternative
2833
exec(
2934
'npm run eslint -- Magento2/Tests/Eslint/' . $testFile,

0 commit comments

Comments
 (0)