mirror of
https://github.com/pestphp/pest.git
synced 2026-07-24 10:30:03 +02:00
fix: package lock fingerprint
This commit is contained in:
+56
-66
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->shouldSkip = true;
|
||||
});
|
||||
|
||||
@@ -21,15 +21,11 @@ it('skips with message')
|
||||
->assertTrue(false);
|
||||
|
||||
it('skips with truthy closure condition')
|
||||
->skip(function () {
|
||||
return '1';
|
||||
})
|
||||
->skip(fn (): string => '1')
|
||||
->assertTrue(false);
|
||||
|
||||
it('do not skips with falsy closure condition')
|
||||
->skip(function () {
|
||||
return false;
|
||||
})
|
||||
->skip(fn (): false => false)
|
||||
->assertTrue(true);
|
||||
|
||||
it('skips with condition and message')
|
||||
@@ -41,162 +37,156 @@ it('skips when skip after assertion')
|
||||
->skip();
|
||||
|
||||
it('can use something in the test case as a condition')
|
||||
->skip(function () {
|
||||
return $this->shouldSkip;
|
||||
}, 'This test was skipped')
|
||||
->skip(fn () => $this->shouldSkip, 'This test was skipped')
|
||||
->assertTrue(false);
|
||||
|
||||
it('can user higher order callables and skip')
|
||||
->skip(function () {
|
||||
return $this->shouldSkip;
|
||||
})
|
||||
->expect(function () {
|
||||
return $this->shouldSkip;
|
||||
})
|
||||
->skip(fn () => $this->shouldSkip)
|
||||
->expect(fn () => $this->shouldSkip)
|
||||
->toBeFalse();
|
||||
|
||||
describe('skip on describe', function () {
|
||||
beforeEach(function () {
|
||||
describe('skip on describe', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->ran = false;
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
afterEach(function (): void {
|
||||
match ($this->name()) {
|
||||
'__pest_evaluable__skip_on_describe__→__skipped_tests__→__nested_inside_skipped_block__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__skip_on_describe__→__skipped_tests__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__skip_on_describe__→_it_should_execute' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__skip_on_describe__→__skipped_tests__→__nested_inside_skipped_block__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__skip_on_describe__→__skipped_tests__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__skip_on_describe__→_it_should_execute' => expect($this->ran)->toBeTrue(),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
});
|
||||
|
||||
describe('skipped tests', function () {
|
||||
describe('nested inside skipped block', function () {
|
||||
it('should not execute', function () {
|
||||
describe('skipped tests', function (): void {
|
||||
describe('nested inside skipped block', function (): void {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not execute', function () {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
})->skip();
|
||||
|
||||
it('should execute', function () {
|
||||
it('should execute', function (): void {
|
||||
$this->ran = true;
|
||||
expect($this->ran)->toBe(true);
|
||||
expect($this->ran)->toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
describe('skip on beforeEach', function () {
|
||||
beforeEach(function () {
|
||||
describe('skip on beforeEach', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->ran = false;
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
afterEach(function (): void {
|
||||
match ($this->name()) {
|
||||
'__pest_evaluable__skip_on_beforeEach__→__skipped_tests__→__nested_inside_skipped_block__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__skip_on_beforeEach__→__skipped_tests__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__skip_on_beforeEach__→_it_should_execute' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__skip_on_beforeEach__→__skipped_tests__→__nested_inside_skipped_block__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__skip_on_beforeEach__→__skipped_tests__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__skip_on_beforeEach__→_it_should_execute' => expect($this->ran)->toBeTrue(),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
});
|
||||
|
||||
describe('skipped tests', function () {
|
||||
describe('skipped tests', function (): void {
|
||||
beforeEach()->skip();
|
||||
|
||||
describe('nested inside skipped block', function () {
|
||||
it('should not execute', function () {
|
||||
describe('nested inside skipped block', function (): void {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not execute', function () {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
});
|
||||
|
||||
it('should execute', function () {
|
||||
it('should execute', function (): void {
|
||||
$this->ran = true;
|
||||
expect($this->ran)->toBe(true);
|
||||
expect($this->ran)->toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
describe('matching describe with skip', function () {
|
||||
beforeEach(function () {
|
||||
describe('matching describe with skip', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->ran = false;
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
afterEach(function (): void {
|
||||
match ($this->name()) {
|
||||
'__pest_evaluable__matching_describe_with_skip__→__describe_block__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__matching_describe_with_skip__→__describe_block__→_it_should_execute_a_test_in_a_describe_block_with_the_same_name_as_a_skipped_describe_block' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__matching_describe_with_skip__→_it_should_execute' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__matching_describe_with_skip__→__describe_block__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__matching_describe_with_skip__→__describe_block__→_it_should_execute_a_test_in_a_describe_block_with_the_same_name_as_a_skipped_describe_block' => expect($this->ran)->toBeTrue(),
|
||||
'__pest_evaluable__matching_describe_with_skip__→_it_should_execute' => expect($this->ran)->toBeTrue(),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
});
|
||||
|
||||
describe('describe block', function () {
|
||||
it('should not execute', function () {
|
||||
describe('describe block', function (): void {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
})->skip();
|
||||
|
||||
describe('describe block', function () {
|
||||
it('should execute a test in a describe block with the same name as a skipped describe block', function () {
|
||||
describe('describe block', function (): void {
|
||||
it('should execute a test in a describe block with the same name as a skipped describe block', function (): void {
|
||||
$this->ran = true;
|
||||
});
|
||||
});
|
||||
|
||||
it('should execute', function () {
|
||||
it('should execute', function (): void {
|
||||
$this->ran = true;
|
||||
expect($this->ran)->toBe(true);
|
||||
expect($this->ran)->toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
describe('matching describe with skip on beforeEach', function () {
|
||||
beforeEach(function () {
|
||||
describe('matching describe with skip on beforeEach', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->ran = false;
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
afterEach(function (): void {
|
||||
match ($this->name()) {
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→__describe_block__→_it_should_not_execute' => expect($this->ran)->toBe(false),
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→__describe_block__→_it_should_execute_a_test_in_a_describe_block_with_the_same_name_as_a_skipped_describe_block' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→_it_should_execute' => expect($this->ran)->toBe(true),
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→__describe_block__→_it_should_not_execute' => expect($this->ran)->toBeFalse(),
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→__describe_block__→_it_should_execute_a_test_in_a_describe_block_with_the_same_name_as_a_skipped_describe_block' => expect($this->ran)->toBeTrue(),
|
||||
'__pest_evaluable__matching_describe_with_skip_on_beforeEach__→_it_should_execute' => expect($this->ran)->toBeTrue(),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
});
|
||||
|
||||
describe('describe block', function () {
|
||||
describe('describe block', function (): void {
|
||||
beforeEach()->skip();
|
||||
|
||||
it('should not execute', function () {
|
||||
it('should not execute', function (): void {
|
||||
$this->ran = true;
|
||||
$this->fail();
|
||||
});
|
||||
});
|
||||
|
||||
describe('describe block', function () {
|
||||
it('should execute a test in a describe block with the same name as a skipped describe block', function () {
|
||||
describe('describe block', function (): void {
|
||||
it('should execute a test in a describe block with the same name as a skipped describe block', function (): void {
|
||||
$this->ran = true;
|
||||
});
|
||||
});
|
||||
|
||||
it('should execute', function () {
|
||||
it('should execute', function (): void {
|
||||
$this->ran = true;
|
||||
expect($this->ran)->toBe(true);
|
||||
expect($this->ran)->toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not skip after the describe block', function () {
|
||||
it('does not skip after the describe block', function (): void {
|
||||
expect(true)->toBeTrue();
|
||||
});
|
||||
|
||||
it('can skip after the describe block', function () {
|
||||
it('can skip after the describe block', function (): void {
|
||||
expect(true)->toBeTrue();
|
||||
})->skip();
|
||||
|
||||
Reference in New Issue
Block a user