TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Ultimate Portfolio: Issue with Tests

Forums > Videos

@mark  

Anyone else coming across this issue when starting the vids on testing? Following Paul's steps, (and using the name testproject here for simplicity sake) when adding:

@testable import testproject

and compiling, get a message that:

File 'testprojecttests.swift' is part of module 'testproject'; ignoring import

and because of that I can't access any of the objects in the project like the dataController, etc.

5      

Hi @mark

I think you got the wrong @testable import testproject.

It should be @testable import UltimatePortfolio. This will give the XTCTest access to the project.

5      

@mark  

Hi Nigel...Thanks for the quick reply. TestProject is the name of my small project I am using to test this out, I'm not using the UltimatePortfolio project name for my test app....Sorry if my post was not clear on that...

5      

@mark  

Found the issue - was related to Product Name and Product Module Name diffs in the Project and Targets settings - I originally had a space in the project name and didnt change things everywhere - this seems to be it.

5      

Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.