computmaxer / karma-jspm

Other
74 stars 52 forks source link

404 when running tests on PhantomJS #175

Closed rolandjitsu closed 7 years ago

rolandjitsu commented 7 years ago

It looks like when I run tests on PhantomJS, I think, this plugin fails to load system-polyfills.js:

21 08 2016 20:12:01.771:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
21 08 2016 20:12:01.773:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
21 08 2016 20:12:01.782:INFO [launcher]: Starting browser PhantomJS
21 08 2016 20:12:02.759:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#1nxq7_gfWd4O7DsYAAAA with id 76877995
21 08 2016 20:12:02.792:WARN [web-server]: 404: /base/jspm_packages/system-polyfills.js
.
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 1 of 1 SUCCESS (0.002 secs / 0.002 secs)
[20:12:03] Finished 'test/unit:ci' after 1.71 s

And my current settings:

module.exports = function (config) {
    config.set({
        frameworks: [
            'jasmine',
            'jspm'
        ],
        reporters: [
            'spec'
        ],
        jspm: {
            stripExtension: false,
            config: 'jspm.config.js',
            serveFiles: ['src/app/**/*!(*.spec).js'],
            loadFiles: [
                'src/app/**/*.spec.js'
            ]
        },
        proxies: {
            '/jspm_packages/': '/base/jspm_packages/',
            '/src/': '/base/src/'
        },
        plugins: [
            'karma-chrome-launcher',
            'karma-jasmine',
            'karma-jspm',
            'karma-phantomjs-launcher',
            'karma-spec-reporter'
        ],
        browsers: [
            'Chrome'
        ]
    });
};
dfreire commented 7 years ago

I'm having the same problem: 404: /base/jspm_packages/system-polyfills.js

Can you try adding basePath: '.' to your config settings?

Smolations commented 7 years ago

+1

I am also encountering this. It doesn't have the same error for system.js, only the polyfills 404. Quite frustrating.

grantreidnz commented 7 years ago

Hello, I got this to work using loadFiles, serveFiles.

It only works if you ensure the polyfill is loaded before anything else, so it has to be in the loadFiles part.

        jspm: {
            config: 'config.js',

            serveFiles: [
                'src/**/*.js',
                'src/**/*.html',
                'src/**/*.css'
            ],

            loadFiles: [
                'jspm_packages/system-polyfills.js',
                'src/**/*.spec.js'
            ]
        },