Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tests with Quick and Nimble

I installed Quick and Nimble frameworks for tests in Swift. But inside test class my class' types is unresolved. In the top of test class I make imports:

import UIKit
import Nimble
import Quick
import MyProject

I know my main target should be at target dependencies and no classes files (except test classes) should be added to compile sources of test target.

Why my files is not visible in test target?

like image 968
Ivan Vavilov Avatar asked Jun 15 '26 21:06

Ivan Vavilov


2 Answers

In XCode 7, you can include internal ivars with a line: @testable import No need to make the ivars public if you want to keep them conceiled from the outside world...

like image 76
Yer00n Avatar answered Jun 17 '26 10:06

Yer00n


You need to declare your classes as public. Otherwise, you won't see anything from your test bundle

Also, the default access level of every property/ function is just its own target. So you also need to declare them public

like image 38
Diego Freniche Avatar answered Jun 17 '26 11:06

Diego Freniche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!