Coder Social home page Coder Social logo

Add a fake() for scout about scout HOT 4 CLOSED

chrisrhymes avatar chrisrhymes commented on May 20, 2024
Add a fake() for scout

from scout.

Comments (4)

driesvints avatar driesvints commented on May 20, 2024 1

I don't think there's a way to do what you want. If you have Meilisearch specific things you'll need to start a meilisearch docker service in your CI and actually hit a meilisearch DB. I don't think we'll add a Scout fake ourselves anytime soon, sorry.

from scout.

driesvints avatar driesvints commented on May 20, 2024

For testing, you should set the Scout driver to null in your phpunit.xml:

<env name="SCOUT_DRIVER" value="null"/>

from scout.

chrisrhymes avatar chrisrhymes commented on May 20, 2024

Ok, will do. But now this returns no results for my API tests?

As an example, the API controller for this route uses Laravel Scout to search the Service models. The test now fails as scout returns no results.

Service::factory()->create([
    'name' => 'Test service',
]); 

getJson(route('api.v1.services', ['name' => 'test']))
        ->assertStatus(200)
        ->assertJsonCount(1, 'data');

from scout.

chrisrhymes avatar chrisrhymes commented on May 20, 2024

Ok. Thank you for your help!

from scout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.