Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

fix: Assert that the comparison process depending of external node ap…#4

Open
ijpatricio wants to merge1 commit intobeyondcode:master
base:master
Choose a base branch
Loading
fromijpatricio:ijpatricio-fix-1

Conversation

@ijpatricio
Copy link

…plications executes OK.

Tests:

$process =newProcess($fullCommand);
$process->run();
if ($process->isSuccessful()) {
returnrtrim($process->getOutput());
}

I'm not sure I can add tests, as I cannot replace Process here, it's being instatiated withnew keyword,
I would go ahead and resolve it with container, but let's see what you have to say?

This would be equivalent

$process =app()->make(Process::class, ['commandline' =>$fullCommand]);

and then we could swap out in the test.

So, in manual testing...

When runningphp artisan dusk, and notpngjs installed

output is

PHPUnit 7.3.2 by Sebastian Bergmann and contributors.E                                                                   1 / 1 (100%)Time: 2.59 seconds, Memory: 14.00MBThere was 1 error:1) Tests\Browser\ExampleTest::testBasicExampleRuntimeException: Could not run the Node process. Probably a missing NPM dependency.module.js:557    throw err;    ^Error: Cannot find module 'pngjs'    at Function.Module._resolveFilename (module.js:555:15)    at Function.Module._load (module.js:482:25)    at Module.require (module.js:604:17)    at require (internal/module.js:11:18)    at Object.<anonymous> (/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/bin/diff.js:1:73)    at Module._compile (module.js:660:30)    at Object.Module._extensions..js (module.js:671:10)    at Module.load (module.js:573:32)    at tryModuleLoad (module.js:513:12)    at Function.Module._load (module.js:505:3)/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiff.php:144/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiff.php:112/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiffTester.php:150/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiffTester.php:59

Then, next, withoutpixelmatch installed

PHPUnit 7.3.2 by Sebastian Bergmann and contributors.E                                                                   1 / 1 (100%)Time: 2.42 seconds, Memory: 14.00MBThere was 1 error:1) Tests\Browser\ExampleTest::testBasicExampleRuntimeException: Could not run the Node process. Probably a missing NPM dependency.module.js:557    throw err;    ^Error: Cannot find module 'pixelmatch'    at Function.Module._resolveFilename (module.js:555:15)    at Function.Module._load (module.js:482:25)    at Module.require (module.js:604:17)    at require (internal/module.js:11:18)    at Object.<anonymous> (/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/bin/diff.js:3:13)    at Module._compile (module.js:660:30)    at Object.Module._extensions..js (module.js:671:10)    at Module.load (module.js:573:32)    at tryModuleLoad (module.js:513:12)    at Function.Module._load (module.js:505:3)/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiff.php:144/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiff.php:112/Users/joaopatricio/code/packages/beyondcode/laravel-visual-diff/src/VisualDiffTester.php:150

Then, when both are installed...

PHPUnit 7.3.2 by Sebastian Bergmann and contributors..                                                                   1 / 1 (100%)Time: 1.9 seconds, Memory: 14.00MBOK (1 test, 1 assertion)

So, what do you think?

@ijpatricioijpatricio mentioned this pull requestAug 24, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@ijpatricio

[8]ページ先頭

©2009-2025 Movatter.jp