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

Calling package results in... Nothing #4

Closed
joe-crick opened this issue Feb 13, 2014 · 21 comments
Closed

Calling package results in... Nothing #4

joe-crick opened this issue Feb 13, 2014 · 21 comments

Comments

@joe-crick
Copy link

Environment: Win 7

Steps to reproduce:

  1. Install gulp-qunit (from npm)
  2. Add the following code to your gulpfile:

var qunit = require('gulp-qunit');
gulp.task('test', function () {
gulp.src('./path/to/my/test_runner.html')
.pipe(qunit());
});

gulp.task('default', function () {
gulp.run('test');
}

Expected Result: The task will run, the qunit tests will run, and output results.

Actual Result: The task runs, and reports that it is finished, but there is no output from qunit.

@jonkemp
Copy link
Owner

jonkemp commented Feb 13, 2014

I need to update the docs but your gulpfile should look more like this.

var gulp = require('gulp');
var qunit = require('gulp-qunit');

gulp.task('test', function () {
    return gulp.src('./path/to/my/test_runner.html')
        .pipe(qunit());
});

gulp.task('default', ['test']);

Not that that is what your problem is.

Can you post a screenshot of the output? Also which version are you using?

@joe-crick
Copy link
Author

Thanks for that. Yeah, I haven't gotten around to updating my gulpfile to the new syntax yet (I should probably do that...). Also, the other bits are in my gulpfile, I just didn't list them for brevity. My bad.

When you say which version - do you mean which version of gulp, or which version of gulp-qunit? Either way, I'm running gulp CLI 3.5.0, and whatever the latest version of gulp-qunit is (I installed yesterday - 2/12/14). Also, I would post a screenshot, but literally nothing happens. I have a few mocha tests that run, and jshint runs, and then... nothing. I have grunt running watch in the background as I dev, so I would expect any latent tasks to run eventually, but I get nothing.

@jonkemp
Copy link
Owner

jonkemp commented Feb 13, 2014

I wish I could help you, but I'm afraid I can't reproduce it. Thanks for letting me know about the issue.

@jonkemp
Copy link
Owner

jonkemp commented Feb 16, 2014

Could you try the most recent version?

@joe-crick
Copy link
Author

No problem. I'll download it, give it a run Monday morning, and let you know how it goes.

@joe-crick
Copy link
Author

I installed this AM. I don't know what could be going wrong, but I still get nothing. I've attached some screenshots, in the event that's helpful:

gulp_output
gulp_file

@jonkemp
Copy link
Owner

jonkemp commented Feb 19, 2014

I'm wondering what happens when you try to just run any tests using phantomjs and QUnit.

I'm wondering if you could install phantomjs globally and then run a test using this [https://github.com/jonkemp/node-qunit] and see if you get any results.

@joe-crick
Copy link
Author

I'll give that a shot, and let you know.

@joe-crick
Copy link
Author

Here are my results. I was able to use the PhantomJs Runner successfully from my root c:\ :

runnerr

When I ran node-qunit from the same location, I got:

2014-02-20 08_11_55-administrator_ node js command prompt

However, phantomjs is installed globally:

2014-02-20 08_12_30-administrator_ node js command prompt - phantomjs -v

So, then, to be safe, I ran the index.js file in my local app folder (I figured, maybe something screwy was going on globally---whatever that might be). So, when I did that, the program ran, but gave me no output (just like gulp-qunit)---so, I fired up WebStorm, and ran indjex.js in the debugger. I got this:

2014-02-20 08_26_32-html - c__whatcountssource_trunk_site_html - _node-qunit-master_index js -

But, sadly, node-qunit does nothing. No output. Nada.

@jonkemp
Copy link
Owner

jonkemp commented Feb 20, 2014

Ok thanks again.

@joe-crick
Copy link
Author

I'm beginning to wonder if this is something weird going on with childProcess.execFile. I ran the code through the debugger again---with full args this time---and the console.log(stdout) is never run.

node_sample

@jonkemp
Copy link
Owner

jonkemp commented Feb 20, 2014

You also have an older version of gulp-qunit. The latest version is 0.2.0. Although that particular line hasn't changed so it may not fix it.

What version of node are you using?

@joe-crick
Copy link
Author

I'll try updating gulp-qunit. I'm running 0.10.18. I'll try updating and see what happens.

I appreciate the help---a lot. I'm getting the impression, though, that this is probably not a bug with your code---rather with something in my Nodesphere, given that it's the call to childProcess.execFile that's dying - and when I call the exe directly it works. I'll let you know how it goes either way, and thanks again!

@jonkemp
Copy link
Owner

jonkemp commented Mar 25, 2014

Getting latest (0.3.1) may fix this.

@crfroehlich
Copy link

I'm getting similar behavior. I'm running node 0.10.26 x64 on Windows; gulp 3.5.5, gulp-qunit 0.3.2.

You can see my whole config at https://github.com/somecallmechief/oj. When I run my test.html in the browser, it loads and executes the whole test suite--no problem. I also installed the https://github.com/jonkemp/node-qunit-phantomjs package, and that executes the test suite--no problem. I see:

C:\Github\node-qunit-phantomjs>node index.js http://localhost/oj/test/test.html
Ajaxify loaded...
ReferenceError: Can't find variable: XRegExp

  http://localhost/oj/bower_components/SyntaxHighlighter/scripts/shCore.js:107
  http://localhost/oj/bower_components/SyntaxHighlighter/scripts/shCore.js:1699

Took 126ms to run 223 tests. 223 passed, 0 failed.

But when I run my gulp test task, I get this:

C:\Github\oj>gulp test
[gulp] Using gulpfile C:\Github\oj\gulpfile.js
[gulp] Starting 'test'...

Testing test.html

[gulp] gulp-qunit: ? QUnit assertions failed in test.html
[gulp] Finished 'test' after 19 ms

My gulp task is pretty thin:

qunit = require('gulp-qunit');
...
gulp.task('test', function() {
    return gulp.src('./test/test.html').pipe(qunit());
});

@jonkemp
Copy link
Owner

jonkemp commented Mar 31, 2014

@somecallmechief error reporting is not great right now. If the task throws an error at all, you see the above message. My guess is that's what's happening in your case.

@crfroehlich
Copy link

@jonkemp ok, makes sense

@crfroehlich
Copy link

@jonkemp I spoke too soon. I carved out the SyntaxHighlighting include which was the source of the exception. My output looks essentially the same:

C:\Github\node-qunit-phantomjs>node index.js http://localhost/oj/test/test.html

Took 111ms to run 223 tests. 223 passed, 0 failed.

C:\Github\node-qunit-phantomjs>

and

C:\Github\oj>gulp test
[gulp] Using gulpfile C:\Github\oj\gulpfile.js
[gulp] Starting 'test'...

Testing test.html

[gulp] gulp-qunit: ? QUnit assertions failed in test.html
[gulp] Finished 'test' after 22 ms

C:\Github\oj>

@jonkemp
Copy link
Owner

jonkemp commented Apr 3, 2014

@somecallmechief I get a result when I run it.

I forked and cloned the project locally, then ran npm and bower install.

When I run gulp test, I get a ton of errors which it prints to the console and then prints this.

Took 25ms to run 45 tests. 0 passed, 45 failed.

[gulp] gulp-qunit: ? QUnit assertions failed in test.html
[gulp] Finished 'test' in 1.66 s

When I run the test file in the browser, I see errors in the console.

GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/enums.js net::ERR_FILE_NOT_FOUND test.html:63
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/common/class.js net::ERR_FILE_NOT_FOUND test.html:75
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/common/functional.js net::ERR_FILE_NOT_FOUND test.html:81
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/common/is.js net::ERR_FILE_NOT_FOUND test.html:83
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/common/methods.js net::ERR_FILE_NOT_FOUND test.html:85
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/common/to.js net::ERR_FILE_NOT_FOUND test.html:91
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/tools/constant.js net::ERR_FILE_NOT_FOUND test.html:109
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/tools/object.js net::ERR_FILE_NOT_FOUND test.html:113
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/tools/objectSql.js net::ERR_FILE_NOT_FOUND test.html:115
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/tools/property.js net::ERR_FILE_NOT_FOUND test.html:117
GET file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/src/coffee/core/tools/shims.js net::ERR_FILE_NOT_FOUND test.html:119

The errors that QUnit is reporting are all similar to this.

Died on test #1 at QUnit.test (file:///C:/Users/jonathan.kemp/Documents/htdocs/oj/bower_components/qunit/qunit/qunit.js:132:11): Object [object Object] has no method 'string'

So, it does work correctly for me. I'm not sure what the problem could be on your end.

@crfroehlich
Copy link

@jonkemp, wacky. I must have something cached locally that is scewing my results. I'll nuke my repo, reclone and go back to square one. Thanks for checking it out.

@crfroehlich
Copy link

@jonkemp, well I suspect it was a local caching issue. I should have elaborated on the build steps for you, you would need to have done

npm install
bower install
gulp compile
gulp test

In order to get past the errors you indicate. But with a fresh clone and a clean install, I do get 223 out of 223 tests succeeded in my console. So thanks! I should have tried that before appending to this. Thanks again for your help.

@jonkemp jonkemp closed this as completed Apr 11, 2014
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

3 participants