The Wayback Machine - https://web.archive.org/web/20210812043339/https://github.com/topics/mocking
Skip to content
#

mocking

Here are 733 public repositories matching this topic...

msw
eddiemoore
eddiemoore commented Aug 10, 2021

Describe the bug

I'm using .on('request:match', (req) => {}) in tests to make sure variables are getting send correctly in the request, however is seems that if I have more than 1 across different tests then they start to fail. I have this in my setupTests file:

beforeAll(() => server.listen({ onUnhandledRequest: 'error' }))
afterAll(() => server.close())
afterEach(() => se
florianschmidt1994
florianschmidt1994 commented Apr 14, 2017

Hey Guys,
I see an IllegalStateException when running one particular test.

What steps will reproduce the problem?
The following code fails each time it is run

Testcase:

package backend.model.posting

import backend.controller.exceptions.ConflictException
import backend.model.location.Location
import backend.model.user.UserAccount
import org.junit.Before
import org.
pappe82
pappe82 commented Feb 24, 2021

A "normal" event on an instance ignores null subscriptions. If I do so on a substituted interface, a null subscription leads to an exception. I have a not so nice legacy code with different listeners to an event an one class that does null-attach internally under some conditions, would be nice if this behaviour would be able to be tested as well. Example code for the problem:

        publ
dbreese
dbreese commented Jul 14, 2021

Take this class, for example:

`
import Foundation

// some comment has import SOMEBADTHING
public protocol TestProtocol: AnyObject {
func doSomething() -> Void
}
`

The generated mock ends up having:

... import SOMEBADTHING ...

Looks like it is looking for "{import .*}" in source files and just adding that verbatim to the output file, causing compile issues.

Improve this page

Add a description, image, and links to the mocking topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the mocking topic, visit your repo's landing page and select "manage topics."

Learn more