Skip to content
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

Getting 0 tests completed after running clicker #178

Closed
ronaksbhavsar opened this issue Nov 22, 2016 · 42 comments
Closed

Getting 0 tests completed after running clicker #178

ronaksbhavsar opened this issue Nov 22, 2016 · 42 comments

Comments

@ronaksbhavsar
Copy link

blob

@lathonez
Copy link
Owner

Please confirm you have performed the following steps:

git clone git@github.com:lathonez/clicker.git
cd clicker
npm install
npm test

@ronaksbhavsar
Copy link
Author

yes
i have followed above steps

@ronaksbhavsar
Copy link
Author

still same

@lathonez
Copy link
Owner

paste the output of the following:

node --version

npm list -g --depth=0

@ronaksbhavsar
Copy link
Author

image

@ronaksbhavsar
Copy link
Author

please check above screenshot

@lathonez
Copy link
Owner

Should be fine I think.

Does npm start work ok?

@ronaksbhavsar
Copy link
Author

ronaksbhavsar commented Nov 22, 2016

yes it's working fine when i run npm start , I am new to karma and jasmine for ionic 2 .

@ronaksbhavsar
Copy link
Author

@lathonez Hi, please update me if you have found anything

@lathonez
Copy link
Owner

Nothing concrete, sorry.

Try:

  • upgrading node to latest LTS (should be 6.5.0)
  • typescript to 2.0.7

After you've done that:

npm cache clean

and these steps again.

If you want to try to debug it yourself, you need to figure out why no specs are being found.

This line here: https://github.com/lathonez/clicker/blob/master/src/test.ts#L36 is a good starting point

@ronaksbhavsar
Copy link
Author

ok

@lathonez
Copy link
Owner

BEFORE you do that, can you paste the entire output of npm test.

Please copy and paste (no screenshot).

@ronaksbhavsar
Copy link
Author

ok

@ronaksbhavsar
Copy link
Author

ronaksbhavsar commented Nov 22, 2016

@lholznagel I have updated node to 6.5.0 , Typescript is already 2.0.7 and installed node modules again. still same

@ronaksbhavsar
Copy link
Author

before Upgrading Node

Clicker@2.3.0 test E:
ng test --code-coverage

22 11 2016 14:51:02.051:WARN [karma]: No captured browser, open http://localhost:9876/
22 11 2016 14:51:02.051:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
22 11 2016 14:51:02.051:INFO [launcher]: Launching browser Chrome with unlimited concurrency
22 11 2016 14:51:02.309:INFO [launcher]: Starting browser Chrome
22 11 2016 14:51:05.749:INFO [Chrome 56.0.2922 (Windows 10 0.0.0)]: Connected on socket /#lyKl8I9gcQo-HU7zAAAA with id 4991
5639

START:

Finished in 0.002 secs / 0 secs

SUMMARY:
√ 0 tests completed

@lathonez
Copy link
Owner

lathonez commented Nov 22, 2016

Apply this diff for debug:

diff --git a/src/test.ts b/src/test.ts
index d12d17f..ca87bd3 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -33,7 +33,7 @@ Promise.all([
     );
   })
   // Then we find all the tests.
-  .then(() => require.context('./', true, /\.spec\.ts/))
+  .then(() => require.context('./pages/page2/'))
   // And load the modules.
   .then(context => context.keys().map(context))
   // Finally, start Karma to run the tests.

run again and paste the output

@ronaksbhavsar
Copy link
Author

ok

@lathonez
Copy link
Owner

Apply the diff and paste the output of npm test.

On 22 Nov 2016 22:05, "ronaksbhavsar" notifications@github.com wrote:

How to debug tests?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#178 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG5tSJiJnim8MeELj8saPWfRFx6FzngTks5rAsxfgaJpZM4K5Jmc
.

@ronaksbhavsar
Copy link
Author

Still same
E:\clicker>npm test

Clicker@2.3.0 test E:\clicker
ng test --code-coverage

22 11 2016 16:43:39.118:WARN [karma]: No captured browser, open http://localhost:9876/
22 11 2016 16:43:39.133:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
22 11 2016 16:43:39.133:INFO [launcher]: Launching browser Chrome with unlimited concurrency
22 11 2016 16:43:39.313:INFO [launcher]: Starting browser Chrome
22 11 2016 16:43:40.938:INFO [Chrome 56.0.2922 (Windows 10 0.0.0)]: Connected on socket /#_Jz5YATKLlf85fM7AAAA with id 3159
998

START:

Finished in 0.002 secs / 0 secs

SUMMARY:
√ 0 tests completed

@lathonez
Copy link
Owner

try using ng-cli directly:

npm install -g angular-cli
ng new PROJECT_NAME
cd PROJECT_NAME
ng test

@ronaksbhavsar
Copy link
Author

@lathonez can you please help me out from this issue?

@ronaksbhavsar
Copy link
Author

Hi @lathonez ,
I have created new project by given commands. and logs are given below:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

E:\CLI-testProject>ng test
25 11 2016 11:19:36.455:WARN [karma]: No captured browser, open http://localhost:9876/
25 11 2016 11:19:36.465:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
25 11 2016 11:19:36.465:INFO [launcher]: Launching browser Chrome with unlimited concurrency
25 11 2016 11:19:36.465:INFO [launcher]: Starting browser Chrome
25 11 2016 11:19:42.818:INFO [Chrome 56.0.2922 (Windows 10 0.0.0)]: Connected on socket /#5G04u69L8P0zPFMUAAAA with id 6892
4662
Chrome 56.0.2922 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (0.433 secs / 0.423 secs)

@ronaksbhavsar
Copy link
Author

image

@ronaksbhavsar
Copy link
Author

it's working fine in mac. i have tested it

@ronaksbhavsar
Copy link
Author

it's working fine it was throwing an exception in debugger

@ronaksbhavsar
Copy link
Author

angular/angular-cli#2125

@ronaksbhavsar
Copy link
Author

image

@ronaksbhavsar
Copy link
Author

thanks for your support

@lathonez
Copy link
Owner

lathonez commented Nov 25, 2016 via email

@ronaksbhavsar
Copy link
Author

Hi, It's been Resolved

@lathonez
Copy link
Owner

Can you tell us what you did to resolve it?

@ronaksbhavsar
Copy link
Author

image
I have added this code for typescript to identify mime type for browser

@andrewgy8
Copy link

For the lazy in karma.conf.js : mime: { 'text/x-typescript': ['ts', 'tsx'] }

@lathonez
Copy link
Owner

lathonez commented Dec 8, 2016

@andrewgy8 - should I be adding this to karma.conf.js?

@andrewgy8
Copy link

andrewgy8 commented Dec 8, 2016

I had the same issue as @ronaksbhavsar, and that seemed to do the trick. Edit: Yes.

@lathonez
Copy link
Owner

lathonez commented Dec 8, 2016

5c0ffeb (will push in a bit)

@ronaksbhavsar
Copy link
Author

ronaksbhavsar commented Dec 9, 2016

yes, you should add

@ronaksbhavsar
Copy link
Author

@lathonez Why you blocked me into gitter into 'clicker ' room?

@lathonez
Copy link
Owner

I removed the room, no one uses it.

@ronaksbhavsar
Copy link
Author

@lathonez ok, can i comment here for issues?

@ronaksbhavsar
Copy link
Author

@lathonez Actually i want to debug protractor, do you know how to debug through visual studio code?

@Wolfium
Copy link

Wolfium commented May 19, 2017

I can confirm that the mime type setting in karma already there in my 2 projects, one working and the other don't is not the solution.

I am thinking in something related with the libraries versions from angular saying 4.1.2, working one had 4.1.1 and after upgrade failing, it got 4.1.3 that is working properly.

Unfortunatly from the yarn upgrade I can't reproduce it now, both project have testing working properly.
Anyway, just to notice output ng version from 0 test (having tests inside) run project:

@angular/cli: 1.0.1
node: 7.3.0
os: win32 x64
@angular/common: 4.1.2
@angular/compiler: 4.1.2
@angular/core: 4.1.2
@angular/forms: 4.1.2
@angular/http: 4.1.2
@angular/platform-browser: 4.1.2
@angular/platform-browser-dynamic: 4.1.2
@angular/router: 4.1.2
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.2

Hope this helps.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants