Fix an issue where beforeEach/afterEach functions were called on other describe blocks with the same name

This commit is contained in:
jshayes
2024-10-12 01:06:16 -04:00
parent 709ecb1ba2
commit b5b8fab09b
17 changed files with 1443 additions and 86 deletions

View File

@ -44,6 +44,36 @@ describe('nested', function () {
})->note('This is a nested describe static note');
})->note('This is describe static note');
describe('matching describe names', function () {
beforeEach(function () {
$this->note('This is before each matching describe runtime note');
})->note('This is before each matching describe static note');
describe('describe block', function () {
beforeEach(function () {
$this->note('This is before each matching describe runtime note');
})->note('This is before each matching describe static note');
it('may have a static note and runtime note', function () {
expect(true)->toBeTrue(true);
$this->note('This is a runtime note within a matching describe');
})->note('This is a static note within a matching describe');
})->note('This is a nested matching static note');
describe('describe block', function () {
beforeEach(function () {
$this->note('This is before each matching describe runtime note, and should not contain the matching describe notes');
})->note('This is before each matching describe static note, and should not contain the matching describe notes');
it('may have a static note and runtime note, that are different than the matching describe block', function () {
expect(true)->toBeTrue(true);
$this->note('This is a runtime note within a matching describe, and should not contain the matching describe notes');
})->note('This is a static note within a matching describe, and should not contain the matching describe notes');
})->note('This is a nested matching static note, and should not contain the matching describe notes');
});
test('multiple notes', function () {
expect(true)->toBeTrue(true);