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 String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

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.