Skip to content

Instantly share code, notes, and snippets.

@jscheid
Created January 27, 2021 22:48
Show Gist options
  • Select an option

  • Save jscheid/37cb4d177a52bf246aba08b274ff1772 to your computer and use it in GitHub Desktop.

Select an option

Save jscheid/37cb4d177a52bf246aba08b274ff1772 to your computer and use it in GitHub Desktop.
➜ prettier-php-test git:(main) ✗ yarn node test.js
yarn node v1.22.10
{
name: 'PHP',
type: 'programming',
tmScope: 'text.html.php',
aceMode: 'php',
codemirrorMode: 'php',
codemirrorMimeType: 'application/x-httpd-php',
color: '#4F5D95',
extensions: [
'.php', '.aw',
'.ctp', '.fcgi',
'.inc', '.php3',
'.php4', '.php5',
'.phps', '.phpt'
],
filenames: [ '.php', '.php_cs', '.php_cs.dist', 'Phakefile' ],
interpreters: [ 'php' ],
aliases: [ 'inc' ],
linguistLanguageId: 272,
parsers: [ 'php' ],
vscodeLanguageIds: [ 'php' ]
}
/private/tmp/prettier-php-test/node_modules/expect/build/index.js:330
throw error;
^
JestAssertionError: expect(received).toEqual(expected) // deep equality
- Expected - 14
+ Received + 5
- array_map(
- function ($arg1, $arg2) use ($var1, $var2) {
+ array_map(function($arg1,$arg2) use ( $var1, $var2 ) {
- return $arg1 + $arg2 / ($var + $var2);
+ return $arg1+$arg2/($var+$var2);
- },
- [
- "complex" => "code",
- "with" => function () {
- return "inconsistent";
- },
- "formatting" => "is",
- "hard" => "to",
- "maintain" => true,
- ]
- );
+ }, array("complex"=>"code","with"=>
+ function() {return "inconsistent";}
+ ,"formatting"=>"is", "hard" => "to", "maintain"=>true));
at Object.<anonymous> (/private/tmp/prettier-php-test/test.js:18:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
matcherResult: {
actual: 'array_map(function($arg1,$arg2) use ( $var1, $var2 ) {\n' +
' return $arg1+$arg2/($var+$var2);\n' +
'}, array("complex"=>"code","with"=>\n' +
' function() {return "inconsistent";}\n' +
',"formatting"=>"is", "hard" => "to", "maintain"=>true));\n',
expected: 'array_map(\n' +
' function ($arg1, $arg2) use ($var1, $var2) {\n' +
' return $arg1 + $arg2 / ($var + $var2);\n' +
' },\n' +
' [\n' +
' "complex" => "code",\n' +
' "with" => function () {\n' +
' return "inconsistent";\n' +
' },\n' +
' "formatting" => "is",\n' +
' "hard" => "to",\n' +
' "maintain" => true,\n' +
' ]\n' +
');\n',
message: [Function (anonymous)],
name: 'toEqual',
pass: false
}
}
error Command failed.
Exit code: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment