Skip to content

Has anyone tried using Pest with this package ?  #52

Open
@vishytk

Description

@vishytk

I am trying this package to modularise one of our application. I have configured Laravel to use pest for testing.

In the main Laravel tree, I have tests/Pest.php configuration file.

I am creating modules in modules directory instead of app-modules. The namespace is set to Talkad.

I have created a module called hms-post.

When I run pest, I see

Modules\hmspost\tests\Unit\ExampleTest instead of Talkad\HmsPost\Tests\Unit\ExampleTest

The ExampleTest (modules/hms-post/tests/Unit/ExampleTest.php)

<?php

namespace Talkad\HmsPost\Tests\Unit;

use Tests\TestCase;

uses(TestCase::class);

test('that true is true', function () {
    echo get_class($this); // shows T\Modules\hmspost\tests\Unit\ExampleTest
    expect(true)->toBeTrue();
});

The Pest configuration

tests/Pest.php under the main Laravel tree

<?php

use Tests\TestCase;
use Illuminate\Foundation\Testing\LazilyRefreshDatabase;

uses(
    TestCase::class,
    LazilyRefreshDatabase::class,
)->in(__DIR__);

Need help on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions