-
-
Notifications
You must be signed in to change notification settings - Fork 197
Ability to run unit tests with --bundle
#4392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also running into the same problem. |
* feat: Implement unit testing with bundle NativeScript/nativescript-cli#4392 * chore: share the regex for `root|page` between bundle-config loader and unit-testing config loader
I still have the same problem using the latest version of the CLI. I created a repository to reproduce the issue https://github.com/cowboyd/nativescript-testing-spike/ |
In order to test the feature you need the next versions of
|
It looks like that link just takes me to the main repository for that packages. Are you meaning one of the tarballs like https://github.com/NativeScript/nativescript-unit-test-runner/tarball/master? |
Yes, that is what I mean - https://github.com/NativeScript/nativescript-unit-test-runner/tarball/master |
Hmmm, I get the following error using both
|
Dunno if it helps, but I attempted to clone the repository and link it for local development and got a different error:
|
Part of a fix outlined in NativeScript/nativescript-cli#4392 (comment)
Hey @cowboyd, Thank you for sending the demo repo. We really appreciate it. I suspect the above errors are due to the fact that I successfully run tests using the steps below:
|
I am still not able to successfully perform this step with either I can get it to install if I say, But then, it fails again with
|
|
That worked! |
When is the plan to release these changes? |
Most probably the release will be next week. |
So this worked in my testing spike, but when I tried to follow these steps in our actual application You can see it on the |
I've looked at the project and noticed that PS:
|
Ah, I see. Yes, I forgot that step. One of the things that is difficult here is that we had to customize our webpack configuration to support accessing command line parameters from the built code. As you can see, we tried to do this as unobtrusively as possible, by "decorating" the webpack config generated by For example, it could look like this: let base = require('nativescript-dev-webpack/webpack.config');
let extension = require('./webpack.enhance');
module.exports = env => {
extension(base);
}; Then, there would be no need to run any update command to keep the boilerplate in sync, because it would be shipped with the npm module. |
Hey @cowboyd, Thank you so much for your suggestion. We really like the idea and will consider it for our next release. |
@Fatme I'm still encountering this problem, even after following the steps to update the The app boots, but not into the test application. Instead it boots into the normal application, just as though I'd run |
More information: for whatever reason, the If I manuall run Then, it eventually reports as connected, but doesn't seem to run the tests: Here's the transcript from the console.
|
Is this happen with the next version of NativeScript CLI? |
It is using this pre-released version of the cli https://github.com/resideo-platform/exemplar/blob/cl%2Fbigtesting/yarn.lock#L4413 |
This prerelease version of the cli doesn't support |
Running As a side note, I avoid using global packages since I've got several different NativeScript projects kicking around and not having a global install means I can keep that variable constant. |
Another thing that I noticed is that webpack is not picking up test files if they happen to be written in TypeScript. Is this a known issue? |
Yes, this is a known issue. You can find more info here #1798 (comment) |
Is your feature request related to a problem? Please describe.
Currently I'm building and running my application with
--bundle
, i.e. with Webpack. However, this is not working for unit tests. This way I'm not sure my services are tested in the same way as when they'll be used at runtime in the actual application.Describe the solution you'd like
Allow running
tns test <platform> --bundle
.Describe alternatives you've considered
No
The text was updated successfully, but these errors were encountered: