Speculator Jasmine / PhantomJs

I cannot run my test using phantomJs.

gulp task

var jasminePhantomJs = require('gulp-jasmine2-phantomjs'); gulp.task('test', function() { return gulp.src('./SpecRunner.html') .pipe(jasminePhantomJs()); }); 

SpecRunner.html

 <script src="lib/jquery.min.js"></script> <script src="lib/lodash.min.js"></script> <script type="text/javascript" src="lib/jasmine-2.0.0/jasmine.js"></script> <script type="text/javascript" src="lib/jasmine-2.0.0/jasmine-html.js"></script> <script type="text/javascript" src="lib/jasmine-2.0.0/boot.js"></script> <script type="text/javascript" src="lib/jasmine-2.0.0/jasmine-jquery.js"></script> <!-- include source files here... --> <script type="text/javascript" src="dist/exportToCsv.js"></script> <!-- include spec files here... --> <script type="text/javascript" src="spec/exportToCsvSpec.js"></script> 

Running this file autonomously reports all of my tests in exportToCsvSpec for transfer. However, when I try to run my gulp task, I get the following:

 Using gulpfile ~/gulpfile.js Starting 'test'... Start running spec file: /ExportToCsv/SpecRunner.html PhantomJS path: /ExportToCsv/node_modules/gulp-jasmine2-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs Loading /ExportToCsv/SpecRunner.html Page has timed out; aborting. gulp-jasmine2-phantomjs: βœ– Assertions failed in SpecRunner.html 'test' errored after 31 s Error in plugin 'gulp-jasmine2-phantomjs' Command failed: 

While I am not familiar with this exact gulp plugin, I am not new to phantom . I can’t understand why this fails.

The code is located here, if you want to play with it Linky CI is also here for those who are interested. Another linky

+6
source share
1 answer

Bug fixed. The gulp plugin gulp gulp-jasmine2-phantomjs mentions the jasmine2-junit requirement that I had, but what I didn't have is an updated boot.js file, which the jasmine2-junit .

From the jasmine2-junit replica

Note that the boot.js file is a modified version of the file with the same name as the default Jasmine 2.0 distribution. the only modification is that JUnitXmlReporter is added as a reporter. Currently it seems impossible to add a reporter while still using stock boot.js.

As you can see here , the change was only a couple of lines added to the boot.js file.

+4
source

Source: https://habr.com/ru/post/972394/


All Articles