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

remove jspm dependency #145

Open
jithinoj opened this issue Apr 19, 2016 · 1 comment
Open

remove jspm dependency #145

jithinoj opened this issue Apr 19, 2016 · 1 comment

Comments

@jithinoj
Copy link

jithinoj commented Apr 19, 2016

We have developed a single page application using aurelia+type script+jspm.Our purpose is remove the jspm packages from the project. We have using karma framework for unit testing. We have moved all files from"jspm_packages" folder to our custom folder named "jspm". The application is working properly. But now when we run the karma unit testing, it cause jspm packages having get 404 error is showing on the console

Our karma.config.js file is following

// Karma configuration

module.exports = function (config) {
config.set({
basePath: './',
baseURL: "/base/",
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jspm', 'jasmine'],

    jspm: {          
        packages: "jspm",
        loadFiles: [

            'test/unit/*.spec.js',

        ],
        paths: {
            '*': '*.js',          
        }
    },

    // list of files to exclude
    exclude: [
        'jspm_packages'
    ],

    files: [
        //'jspm/system.js',
        // 'jspm/system-polyfills.js',

    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
        'test/**/*.js': ['babel'],
        'src/**/*.js': ['babel']
    },
    'babelPreprocessor': {
        //options: {                
        //    sourceMap: 'inline',
        //    modules: 'system',
        //    moduleIds: false,
        //    optional: [
        //      "es7.decorators",
        //      "es7.classProperties"
        //    ]
        //}
        //,
        options: {
            // optional: ['runtime'],  // per http://babeljs.io/docs/usage/options/
            sourceMap: 'inline',
            moduleIds: false,
            modules: 'system',
            optional: [
              "runtime",
              "es7.decorators",
              "es7.classProperties"
            ]
        }
        //filename: function (file) {
        //    return file.originalPath.replace(/\.js$/, '.es7.js');
        //},
        //sourceFileName: function (file) {
        //    return file.originalPath;
        //}
    },
    proxies: {
        '/src/': '/base/src/',
        '/test/': '/base/test/',
        '/jspm_packages/': '/base/jspm_packages/',
        '/node_modules/': '/base/node_modules/'
    },
    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_DEBUG,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
});

};

and config.js file settings is foloowing

paths: {
"": "src/",
"github:": "jspm/github/",
"npm:": "jspm/npm/",

@hoisel
Copy link

hoisel commented Jun 29, 2016

Try replace 'jspm_packages' ocorrencies for 'jspm' on proxies section

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