-
-
Notifications
You must be signed in to change notification settings - Fork 197
TS Tests Aren't Run the First Time #2766
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
Workaround:
|
It seems that
However, when using the bundle workflow, the error is totally different from the described one:
I logged this error as a separate issue here. However, as the above steps are already outdated, they should be transformed to the following steps:
|
From @joeskeen on October 12, 2016 16:15
tns
version: 2.4.0-2016-10-06-6743OS: OS X El Capitan 10.11.6
If you add a TypeScript unit test file (
/app/tests/*.ts
), it won't get executed on the first test run, only the second one. Steps to reproduce:Clone the
sample-Groceries
repo and check out theangular-start
branchrun
tns test init
using Jasmine as test framework. This will create a single JS test file under/app/tests
.run
tns test ios
. In the console you will see the following:Note that it only runs one spec (the JS one that was already there). Go ahead and kill the test process.
create a file in
/app/tests
calledmyTest.ts
, and add a simple test inside (you can copy/paste the code from the JS one and change some of the strings to make them unique). You also may have to add a type reference or declaration to get it to compile.run
tns test ios
again. You will see it only runs one test (not recognizing the new one).kill the process and run it again. This time you will see output like this:
So it appears that TS files in the
/app/tests/
folder do get transpiled, but not until after the.js
files are collected for testing by Karma. This means that if we want to use TS for testing in continuous integration, we have to run the test suite twice.Copied from original issue: NativeScript/nativescript-unit-test-runner#22
The text was updated successfully, but these errors were encountered: