简体   繁体   中英

PhantomJS failed to load your page. Use --force to continue

I am trying to run test with grunt-contrib-jasmine trough command line "grunt jasmine", but its fails giving the warning : "PhantomJS failed to load your page. Use --force to continue."...

base.spec.js:

describe('Namespace',function(){
    it('Provides the global *** object',function(){
        expect(***).to.be.an('object');
        expect(***).to.include.keys('App','Templates');
    });
});

gruntfile.js including this:

jasmine : {
    src : ['apps/<%=target%>/js/**/*.js'],
        options : {
            host : 'http://127.0.0.1:5000', 
            specs : 'tests/<%=target%>/**/*spec.js',
        }
},
.
.
.
grunt.loadNpmTasks('grunt-contrib-jasmine');

Can't understand what is wrong...

Please help, Thanks in advance...

In gruntfile.js make your src: 'apps/<%=target%>/js/**/FileName', (remove the .js after filename)

Add this before jasmine: grunt.initConfig({ pkg: grunt.file.readJSON('package.json'),

connect: { test : { port : 8000, base: 'test' }

},

set a default task so it can perform connection and then execute: grunt.registerTask('default', ['connect','jasmine']);

if it yet fails then try doing grunt jasmine --force to know where its failing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM