Test your lanes locally #21926
Replies: 2 comments
-
Hello, Yes, you can test lanes locally without integrating with real servers or backends by using mocking and stubbing techniques. Here are some steps you can follow: Mocking API Calls: Use libraries like WebMock or VCR to mock HTTP requests. These tools allow you to simulate API responses from GitHub/GitLab without making actual network calls. ` require 'webmock/rspec' describe 'My Lane' do it 'makes a successful API call to GitHub' do In this example, stub_request is used to mock the API call to GitHub, and the test checks if the lane method behaves correctly with the mocked response. Hope this work for you. |
Beta Was this translation helpful? Give feedback.
-
Hello, Mocking and Stubbing: |
Beta Was this translation helpful? Give feedback.
-
Hello
Is there a way to test lanes locally without an integration with real servers/backends?
For example I wrote a lane that makes an api call to github/gitlab and I want to unit test this lane to be sure it is working properly and have a guarantee that when I change won't break the excepted result?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions