Skip to content

Commit

Permalink
moving ->toMatchElementSnapshot to shared helper
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Nov 22, 2023
1 parent e1fbb5a commit 48ac966
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/helpers/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ function dd(...$args)
dump(...$args);
die;
}

expect()->extend('toMatchElementSnapshot', function () {
$this->toSnapshot()->toMatchSnapshot();

Check failure on line 52 in src/helpers/Test.php

View workflow job for this annotation

GitHub Actions / test

Undefined variable: $this
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"ref": "posts\/foo-bar",
"status": "live",
"structureId": null,
"url": "http:\/\/localhost:8080\/posts\/foo-bar",
"url": "http:\/\/localhost:8080\/index.php?p=posts\/foo-bar",
"authorId": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ref": "posts\/foo-bar",
"status": "live",
"structureId": null,
"url": "http:\/\/localhost:8080\/posts\/foo-bar",
"url": "http:\/\/localhost:8080\/index.php?p=posts\/foo-bar",
"authorId": null,
"entriesField": [
{
Expand All @@ -49,7 +49,7 @@
"ref": "posts\/child",
"status": "live",
"structureId": null,
"url": "http:\/\/localhost:8080\/posts\/child",
"url": "http:\/\/localhost:8080\/index.php?p=posts\/child",
"authorId": null
}
]
Expand Down
4 changes: 0 additions & 4 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
|
*/

expect()->extend('toMatchElementSnapshot', function () {
$this->toSnapshot()->toMatchSnapshot();
});

/*
|--------------------------------------------------------------------------
| Functions
Expand Down

0 comments on commit 48ac966

Please sign in to comment.