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

Plugin freezes stating " Running Jasmine with PhantomJS" when I add specHtml to my gulp task #64

Open
alyn000r opened this issue Apr 20, 2016 · 1 comment

Comments

@alyn000r
Copy link

I am using [email protected] to write unit tests. This is my gulp task:

gulp.task('test:unit-test', function() {
    return gulp.src('test/unit/activity/Activity.spec.js')
        .pipe(jasmine({
            integration: true,
            keepRunner: './',
            vendor:[
                'jspm_packages/system.js',
                'system.config.js',
                'test/activity/loader/debug-config.js'
            ],
            specHtml: 'index.html',
            abortOnFail: true

        }));
});

When I remove the specHtml from my options it tries to run my unit tests and all the test fail, as it needs system.js to load before the system.config.js file. So I am trying to create a HTML template which jasmine should use for running unit tests.

I was trying to try to load a simple index.html file which lies on the base path of my project. The index.html file is just a blank file. See below:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Examples</title>
</head>
<body>

</body>
</html>

When I run it with the specHtml option in there the plugin just freezes on this command:

[12:44:09] Requiring external module babel-register
[12:44:10] Using gulpfile ~/source/cas-core-renderer-gulp/gulpfile.babel.js
[12:44:10] Starting 'test:unit-test'...
[12:44:10] Running Jasmine with PhantomJS

I waited like 15 minutes and it never moved so I assume something is wrong. Not sure if this is a bug with the plugin or what the error is. Can you please tell me how to see the logs or what is going on here ?

Thanks

O/S Mac OSX El Capitan
Node: 5.3.0
phantomJS : 2.1.1

@dflynn15
Copy link
Owner

Sorry for the late response, work has been keeping me heads down! First, I want to draw attention to the default specRunner.html (https://github.com/dflynn15/gulp-jasmine-phantom/blob/master/lib/specRunner.handlebars). Obviously it is in Handlebars, however the scripts need to be specified in the <head> otherwise nothing will happen and the plugin will just keep checking for "complete".

The plugin continually checks for the reporter to give the "All clear" or "Things exploded" before Phantom exits. If the reporter does not exist in the <head> than the plugin will never receive the signal that it is expecting.

I would encourage you to just use the keepRunner flag and look at the .html file that is output and model a custom one based off of that. However, I think the underlying problem is that there may be something that is causing the 'jspm_packages/system.js' to defer execution before 'system.config.js' is being read in.

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

2 participants