Unit Testing Packages

I have followed the unit-testing guide found in the documentation. I was able to successfully deploy the unit test however I could not name it unitTests or it would fail and not recognize the package.

My main question is how can I import functions from files that are outside of my unittests package? For example, a function from the app modules, lib, folder? Thanks in advance!

App packages adhere to the same naming convention requirements as npm packages, hence OXIDE transforms a name such as unitTests to unittests (Details can be found here).

To your main question - it is not possible to import functions from files outside of app packages into them (from e.g. views or app modules). Currently it’s only possible to test code inside an app package, and then exporting that code for use e.g. in a view or a TS app module. An app package therefore represents a library that you can reference in your app (and eventually in CloudCode too).