Skip to content

Commit e00b46c

Browse files
authored
Merge branch 'main' into feat/to-have-title-regex
2 parents 07587a7 + 637264e commit e00b46c

File tree

9 files changed

+78
-18
lines changed

9 files changed

+78
-18
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ coverage.xml
1010
*.swp
1111
*.swo
1212
.phpunit.cache
13-
1413
# Playwright
1514
node_modules/
1615
/test-results/

.temp/e2e/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*
2+
!.gitignore

.temp/e2e/.gitkeep

Whitespace-only changes.

.temp/e2e/runtime.spec.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
]
2727
},
2828
"require-dev": {
29+
"laravel/pint": "^1.20",
2930
"pestphp/pest-dev-tools": "^3.4.0"
3031
},
3132
"minimum-stability": "dev",

pint.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"array_push": true,
5+
"backtick_to_shell_exec": true,
6+
"date_time_immutable": true,
7+
"declare_strict_types": true,
8+
"lowercase_keywords": true,
9+
"lowercase_static_reference": true,
10+
"final_class": true,
11+
"final_internal_class": true,
12+
"final_public_method_for_abstract_class": true,
13+
"fully_qualified_strict_types": true,
14+
"global_namespace_import": {
15+
"import_classes": true,
16+
"import_constants": true,
17+
"import_functions": true
18+
},
19+
"mb_str_functions": true,
20+
"modernize_types_casting": true,
21+
"new_with_parentheses": false,
22+
"no_superfluous_elseif": true,
23+
"no_useless_else": true,
24+
"no_multiple_statements_per_line": true,
25+
"ordered_class_elements": {
26+
"order": [
27+
"use_trait",
28+
"case",
29+
"constant",
30+
"constant_public",
31+
"constant_protected",
32+
"constant_private",
33+
"property_public",
34+
"property_protected",
35+
"property_private",
36+
"construct",
37+
"destruct",
38+
"magic",
39+
"phpunit",
40+
"method_abstract",
41+
"method_public_static",
42+
"method_public",
43+
"method_protected_static",
44+
"method_protected",
45+
"method_private_static",
46+
"method_private"
47+
],
48+
"sort_algorithm": "none"
49+
},
50+
"ordered_interfaces": true,
51+
"ordered_traits": true,
52+
"protected_to_private": true,
53+
"self_accessor": true,
54+
"self_static_accessor": true,
55+
"strict_comparison": true,
56+
"visibility_required": true
57+
}
58+
}

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class Compiler
2020
* @param array<int, Operation> $operations
2121
*/
2222
public function __construct(
23-
private array $operations
23+
private readonly array $operations
2424
) {
2525
//
2626
}

src/PendingTest.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@
44

55
namespace Pest\Browser;
66

7+
use Pest\Browser\Contracts\Operation;
8+
79
/**
810
* @internal
911
*/
1012
final class PendingTest
1113
{
1214
/**
1315
* The pending operations.
16+
*
17+
* @var array<int, Operation>
1418
*/
1519
private array $operations = [];
1620

21+
/**
22+
* Ends the chain and builds the test result.
23+
*/
24+
public function __destruct()
25+
{
26+
$this->compile();
27+
}
28+
1729
/**
1830
* Visits a URL.
1931
*/
@@ -35,9 +47,9 @@ public function toHaveTitle(string $title): self
3547
}
3648

3749
/**
38-
* Build the test result.
50+
* Compile the JavaScript test file.
3951
*/
40-
public function build(): void
52+
public function compile(): void
4153
{
4254
$compiler = new Compiler($this->operations);
4355

@@ -49,12 +61,4 @@ public function build(): void
4961

5062
expect($result->ok())->toBeTrue();
5163
}
52-
53-
/**
54-
* Ends the chain and builds the test result.
55-
*/
56-
public function __destruct()
57-
{
58-
$this->build();
59-
}
6064
}

tests/Example.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use function Pest\Browser\visit;
46

57
it('may have a title at playwright', function () {

0 commit comments

Comments
 (0)