Giter VIP home page Giter VIP logo

karma-jspm's People

Contributors

ahmedshuhel avatar amitport avatar aurelienribon avatar bbosman avatar capaj avatar caseyhoward avatar charliekump-wf avatar comdiv avatar computmaxer avatar dotnetcarpenter avatar dwilson6 avatar finalclass avatar frederikns avatar ggranum avatar gu1 avatar guybedford avatar jayudey-wf avatar jeroenvinke avatar m-a-r-c-e-l-i-n-o avatar matoilic avatar maxwellpeterson-wf avatar rafi-cengage avatar serkansipahi avatar shanesizer-wf avatar svi3c avatar teresarevious-wf avatar timkindberg avatar trentgrover-wf avatar valotas avatar zewa666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karma-jspm's Issues

source line numbers for AssertionErrors when transpiling with Babel or Traceur

When an AssertionError occurs in a transpiled test, the report looks like this:

AssertionError: expected 'Hello, fooo.' to equal 'Hello, foo.'
    at Context.eval (base/test/hello.spec.js!eval:23:44)

Ideally it would show the line in the source file, like base/test/hello.spec.js:11:44

I'm not sure what projects would need changes to plumb this through, but IMO this ought to work out of the box. Opening an issue here to track upstreams.

Fairly extensive discussion at babel/karma-babel-preprocessor#4

Custom alias in map returning a 404

I've got an issue where one of my custom aliases in my config.js file is returning 404 when running tests.
In my config.js file, I reference a config file as so:

System.config({
  "map": {
    "main.config": "./modules/main.config"
  }
});

This allows me to add the following to files like this: import mainConfig from 'main.config', rather than referencing the whole path.
The test returns: WARN [web-server]: 404: /base/modules/main.config.js. When it errored, I assumed I would need to add it as a path to the karma config file:

paths: {
  'main.config': 'modules/main.config.js'
}

Unfortunately, this does not work either. Is there something I am doing wrong? Help is really appreciated. Thanks

run tests on CI system

How do you run your tests on a CI system?

PhantomJS isn't working. I'm sick of using SauceLabs to run my unit tests in e.g. Chrome Browser because it increases the build time.

Silent Errors

#7 Introduced a change so that any System.import errors would be thrown to Karma. Before this change, errors from System.js were silent altogether.

I'm using [email protected] and I'm still getting silent errors. Take a look at https://github.com/Workiva/karma-jspm/blob/4d3511e6d928ff6e6d8fa0d79249c46c6d3276bc/src/adapter.js#L58

and you'll see

 ['catch'](function(e){
                setTimeout(function() {
                    throw e;
            });
        });

If I make the following change, the errors are correctly reported to Karma:

 ['catch'](function(e){

                    throw e;

        });

So, throwing immediately instead of on the next tick fixes my issue.

Thoughts? Am I missing something, why are we using setTimeout?

WARN [web-server]: 404

Karma gives me a 404,

WARN [web-server]: 404: /source/components/todotable/todotable.spec.js

The file is served at /base/source/components/todotable/todotable.spec.js, but JSPM is not adding the base prefix.

Here's my JSPM config in package.json

jspm: {
      useBundles: true,
      loadFiles: ['source/components/**/*.spec.js'],
      serveFiles: ['source/components/**/!(*.spec).js']
    },

Cannot find "es6-module-loader.js" when starting Karma (via karma-jspm plugin)

After setting up JSPM and SystemJS I have a working app, but while configuring Karma and starting the server I get this error.

[watcher] Pattern "MY_PACKAGE_DIR/es6-module-loader.js" does not match any file.

From the karma-jspm docs: https://www.npmjs.com/package/karma-jspm
This plugin assumes you are using jspm in your project. You will need to have a config.js in the root of
your project (though this is configurable) as well as a jspm_packages directory containing systemjs
and the es6-module-loader.

However, the SystemJS docs say:
Built on top of the ES6 Module Loader polyfill.

Is this a problem with karma-jspm or a misconfiguration of jspm itself?

TDD

It would be nice to enable the tdd gulp-karma option, but when I disabled singleRun this didn't seem to work unfortunately.

Doesn't seem to be transpiling es6

I have the following very simple test.js

describe("some test", () => {
    it("should pass", () => expect(true).toBe(true));
    it("should fail", () => expect(false).toBe(true));
})

With the very simple karma configuration

module.exports = function(config) {
  config.set({
    frameworks: ['jspm', 'jasmine'],
    browsers: ['Chrome'],
    autoWatch: true,
    jspm: {
        loadFiles: ['tests/*.js'],
        serveFiles: []
    },
    files: [
    ],

    client: {
    }
  });
};

Running this cannot seem to interpret my js file

(program):1 Uncaught SyntaxError: Unexpected token )
:9876/absoluteW:/.../node_modules/karma-jspm/src/adapter.js?24ddd220d7a2584ac6ab786e71addf444e440a4d:59 Uncaught Error loading "tests/simpleTest" at http://localhost:9876/base/tests/simpleTest.js
Error evaluating http://localhost:9876/base/tests/simpleTest.js
Uncaught SyntaxError: Unexpected token )

Error loading files

Directory structure:

/
|---app
|    \---myapp.js
|---jspm-packages
|---spec
|    \---myapp-spec.js
|---config.js
\---karma.conf.js

In karma.conf.js:

jspm: {
    loadFiles: [ 'spec/**/*-spec.js' ],
    serveFiles: [ 'app/**/*.js' ]
}

When I run karma, files in the app directory are not loaded, as karma prefixes the path with base/. How do I solve this?

Problem referencing exported class from spec

How do I references an exported class correctly?

I have this config:

// karma.conf.js

    basePath: '',
    ...
    jspm: {
      loadFiles: ['src/**/*.js', 'test/**/*.js']
    },

...
// test/bindtable.spec.js
import {BindTable} from '../src/bindtable';
...
// src/bindtable.js
import {Record} from './record';
import {Table}  from './table'; 

// re-export
export {Bindable} from './bindable';

export function createBindTable (options) {
  new BindTable(options);
}

export class BindTable {

But I keep getting this error: WARN [web-server]: 404: /base/bindtable.js
Is it because I fuck up my imports/exports before I get to export the BindTable class?

$ karma start
WARN [karma]: Port 9876 in use
INFO [karma]: Karma v0.12.31 server started at http://localhost:9877/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 41.0.2272 (Mac OS X 10.10.2)]: Connected on socket kyKTwj32lmkUsoE64jVj with id 69984753
WARN [web-server]: 404: /base/bindtable.js
Chrome 41.0.2272 (Mac OS X 10.10.2): Executed 0 of 0 ERROR (0.003 secs / 0 secs)

Even if I reference another file, it still keeps warning about this import of bindtable?

Is it because of this seeting in package.json ?

"main": "src/bindtable.js",

I'm totally lost here https://github.com/kristianmandrup/aurelia-rethink-bindtable

(test-case) Unit tests not working beta.2

Hello, for the past month I been trying to get unit tests to run with either karma-jspm or karma-systemjs.

I have created a bare bones repo for you to test and help get them running.

npm i
jspm update
gulp tsd
gulp test

In the karma.config you will see 2 configurations. One for karma-jspm and one for karma-systemjs.
Please comment/uncomment the appropiate configuration.

I would really appreciate the team taking their time and trying to get them to run. I'm pulling out my har, I really need to get my units tests running again.

The repo contains 2 layouts. They differ by baseURL.

Layout 1 uses plugin-typescript, with a baseURL of "/"

Layout 2 is what I'm using in my project now. The typescript is transpiled into /.build/app
the jspm_packages and config live in .build.

The only thing I care about is to get the unit tests to run. If that means you need to rearrange things, go ahead.

The test repo:
https://github.com/robertbaker/system-unit-test

Can't find SystemJS

Update: this all works if I downgrade to System 0.16.*

Few facts:

Spent a few hours trying to debug this, and I think my setup is pretty standard. Folder structure here:

| root
| - /jspm_packages
| - /node_modules
| - /src
| --   /app <- all app code here
| ---      system.config.js <-- SystemJS config file.
| - /test
| --   /unit <- all test code here
| - karma.conf.js

Snippet from my system.config.js:

System.config({
  "baseURL": "",
  "transpiler": "babel",
  "babelOptions": {
    "optional": [
      "runtime"
    ]
  },
  "paths": {
    "*": "*.js",
    "github:*": "../jspm_packages/github/*.js",
    "npm:*": "../jspm_packages/npm/*.js"
  },
  "defaultJSExtensions": true
});

My karma config:

module.exports = function(config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',
        frameworks: ['jspm', 'jasmine'],
        browserNoActivityTimeout: 20000,
        browsers: ['PhantomJS'],
        reporters: ['spec', 'coverage'],
        singleRun: true,
        colors: true,

        jspm: {
            config: 'src/app/system.config.js',
            loadFiles: [
                'node_modules/phantomjs-polyfill/bind-polyfill.js',
                'test/unit/**/*.js'
            ],
            serveFiles: [
                'src/app/**/*.js'
            ]
        },

        proxies: {
            '/jspm_packages': '/base/jspm_packages'
        },

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

        logLevel: config.LOG_ERROR,

        preprocessors: {
            'test/unit/**/*.js': ['babel', 'coverage'],
            'src/app/**/*.js': ['babel', 'coverage']
        },

        babelPreprocessor: {
            options: {
                modules: 'system',
                compact: false
            }
        },

        coverageReporter: {
            // specify a common output directory
            dir: 'coverage/',
            reporters: [{
                type: 'html',
                subdir: 'report-html'
            }, {
                type: 'lcov',
                subdir: 'report-lcov'
            }]
        }


    });
};

The error I get when running karma (local version, from /client) ./node_modules/.bin/karma start karma.config.js is this:

PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
  TypeError: 'undefined' is not a function (evaluating 'System.register')
  at /Users/dave/Sites/kickstart-app/client/src/app/system.config.js:9

PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.1 secs / 0 secs)

It seems that System is undefined, which means that it's not loading? Seems to be a path issue, but I surely cannot figure this out for the life of me...

Using import in tests

Im running into an issue when trying to import a module to test. I have an angular 1.3.15 app up working with jspm and babel to transpile es6. I installed karma-jspm to run unit tests and it works great until I try to import a module to test. Im currently importing a module with a directive on it. When I look at my console I see this error:

Error loading "app/directives/loading-spinner/loading-spinner.spec" at http://localhost:9876/base/app/directives/loading-spinner/loading-spinner.spec.js
Error loading "npm:[email protected]" at http://localhost:9876/base/jspm_packages/npm/[email protected]
Error evaluating http://localhost:9876/base/jspm_packages/npm/[email protected]
Error evaluating http://localhost:9876/base/jspm_packages/npm/[email protected]/browser.js
TypeError: 'undefined' is not a function (evaluating 're.test.bind(re)')
at undefined

My karma.conf file has a jspm object that looks like this:

jspm: {
      // Edit this to your needs
      loadFiles: ['app/**/*.spec.js'],
      serveFiles: []
    },

My jspm set up keeps config.js and jspm_packages in the default locations. Let me know if you need anymore info from me, or you have suggestions.

Load a mapped package

Sometimes the need for a globally loaded package needs to be loaded without another package requiring it. For example Polymer. Currently I can load this with the pattern but it would be a lot nicer just to use the mapping like so :

config.js

System.config({
  "map": {
    "webcomponentsjs": "github:webcomponents/[email protected]",
  }
});

karma.conf.js

jspm: {
      serveFiles: ['src/**/*.js'],
      loadFiles: ['webcomponentsjs','test/**/*.js']
    },

Karma template import not working with ES6 (SystemJS)

I posted an issue on the SystemJS text plugin with regards to the plugin not working correctly in ES6.

This is the ticket:

"I've managed to get this plugin to work really well with directives but when I try and use it in a karma test, it doesn't seem to work (I am using JSPM).

import t from './template.html!text';

This doesn't work, so I tried importing the plugin at the top too:

import 'systemjs/plugin-text';
import t from './template.html!text';

This too doesn't work. Is there something else I need to do to enable this to work? There is no error unfortunately - the tests just do not ever run. Thanks"

Original here: The original can be seen here: systemjs/plugin-text#15.

Just wondering if this is something anyone can help with?

Path separator problem.

This is a function from karma-jspm/src/init.js

function expandGlob(file) {
  return glob.sync(file.pattern || file).map(function (filePath) {
    return filePath.replace(/\//g, path.sep);
  });
};

Is there any specific reason why you are replacing / with \? This is actually causing System.import fail on windows as path.sep is \ in windows. On *nix it is okay I guess because it's essentially doing nothing there.

testing files returning 404

This is my karma configuration. Basically I am trying to just load the testing files and give me 404 for the files.

At the same I want to understand why is trying to pull jspm_packages/system-polyfills.src.js.

{
  "dependencies": {
    "jspm": "^0.15.7"
  },
  "devDependencies": {
    "chai": "^3.0.0",
    "karma": "^0.12.37",
    "karma-jspm": "^2.0.0-beta.1",
    "karma-mocha": "^0.2.0",
    "karma-mocha-reporter": "^1.0.2",
    "karma-phantomjs-launcher": "^0.2.0",
    "karma-sinon-chai": "^1.0.0",
    "mocha": "^2.2.5",
    "phantomjs": "^1.9.17",
    "phantomjs-polyfill": "0.0.1"
  },
  "jspm": {
    "main": "src/liquid",
    "directories": {},
    "dependencies": {
      "bootstrap": "github:twbs/bootstrap@^3.3.5",
      "classnames": "github:JedWatson/classnames@^2.1.2",
      "css": "github:systemjs/plugin-css@^0.1.13",
      "font": "github:systemjs/system-font@master",
      "less": "github:aaike/jspm-less-plugin@^0.0.5",
      "react": "npm:react@^0.14.0-beta1",
      "react-dom": "npm:react-dom@^0.14.0-beta1"
    },
    "devDependencies": {
      "babel": "npm:babel-core@^5.1.13",
      "babel-runtime": "npm:babel-runtime@^5.1.13",
      "core-js": "npm:core-js@^0.9.4"
    }
  }
}
WARN [watcher]: Pattern "{PATH}/jspm_packages/system-polyfills.src.js" does not match any file.
INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket 0_HAsSDiLTc3h8HNoxn4 with id 88612377
WARN [web-server]: 404: /test/components/button/button.spec.js
module.exports = function(config) {
  config.set({
    basePath: '',
    port: 9876,
    colors: true,
    autoWatch: false,
    singleRun: true,
    logLevel: config.LOG_INFO,

    jspm: {
      loadFiles: [
        'test/**/*.spec.js'
      ],
      serveFiles: [
        'src/**/*.js'
      ]
    },
    exclude: [],

    browsers: ['PhantomJS'],
    reporters: ['mocha'],
    frameworks: [
      'jspm',
      'mocha',
      'sinon-chai'
    ],
    plugins: [
      'karma-jspm',
      'karma-sinon-chai',
      'karma-mocha',
      'karma-mocha-reporter',
      'karma-phantomjs-launcher'
    ],
    preprocessors: {

    }
  })
}

Uncaught ReferenceError: System is not defined when karma runs

I do have two warnings before this error:

WARN [watcher]: Pattern "C:\git_devel\zen\gui\zuiplugin_dll\app\jspm_packages
\es6-module-loader@.js" does not match any file.
WARN [watcher]: Pattern "C:\git_devel\zen\gui\zuiplugin_dll\app\jspm_packages
\system@
.js" does not match any file.

I have SystemJS v0.9.0 in my project. This might be the problem, because this version doesn't have @ in it's name.

Need to watch for file updates (running karma from WebStorm)

After some trial and error, I can now run test on command line and WebStorm (horay!)

But there is one problem. Since WebStorm will keep the karma running, when I make a change to the code (adding a test for example), jspm does not pickup the change. When I run the test, the cached version is used. I have to stop the karma server and run it again so jspm could pick it up.

This work flow is working fine for karma-requirejs.

not working with SystemJS 0.17.x

Thanks for this awesome project. It really does an awesome job at abstracting out the integration between jspm and karma.

That being said, I have tried to use the newest jspm-cli, which installs the newest system.js and its broken.

Im sure you are aware that 0.17.x has introduced new changes to the core library. https://github.com/systemjs/systemjs/releases

  • es6-module-loader is no longer needed
  • System.defaultJSExtensions: true is needed to provided backwards compatibility

These and other breaking changes are hindering karma-jspm from working with the newest System.js

ES6 support? (Error evaluating http://localhost:9876/base/jspm_packages/traceur.js)

I've been trying to add karma-jspm to my project (see tests-karma branch) but I'm getting errors, which I've tracked down to the System.import in adapter.js throwing the error string:

Error evaluating http://localhost:9876/base/jspm_packages/traceur.js

This seems to happen whenever any of the specs or any of the files the specs load is in the ES6 format.

If all loaded files are in AMD or CJS format, everything seems to work fine.

Is karma-jspm supposed to work with ES6 and if so, is there any working example I could take a look at?

race condition when using AngularJS? .. or in which file should I put my external dependencies?

started to unit test an angular app with karma-jspm, e.g. I included the loading of dependencies ...

import { } from 'angular';
import { } from 'angular-ui-router';
import { } from 'angular-material';
import { } from 'angular-mocks';

... into each separate .spec.js file. but that seems to lead to race conditions, putting karma in the browser kind of into an endless loop / timeout.

thus I'm wondering where we should load our external dependencies and if that has to happen only once for all tests or separately for each test file.

Can't seem to get it working

Sorry if this is because of my setup or my conf, but it seems that I can't this running. Here's my code. Any help would be appreciated.

proxies configuration option since 1.0.0 no longer works (and I don't know how to solve it via `System.config({ baseURL: '/some/path' }` )

as our jspm_packages don't reside in the project root but in ./front/main/jspm_packages/, we not only used the config option ...

jspm: {
        config: '/front/main/config.js',
        packages: '/front/main/jspm_packages/'
...

... but used as well the proxies config option:

proxies: {
      '/jspm_packages/': '/base/front/main/jspm_packages/',
      '/lib/': '/base/front/main/lib/'
    }

now since 1.0.0 without (functional) proxies option, I don't know how I'd do the configuration to get it working again.
maybe you can give us a hint.

  • jspm's config.js file is in folder ./front/main wherein no basePath is set (because ./front/main folder get's served in development environment)
  • karma.conf.js file is in folder ./front/test/unit (with basePath: '../../..')

ES6 import doesn't work

Using import {React, Component} from 'react' doesn't work in any of the files you use it.

when my js file is named log_decorator.js, karma-jspm adapter always fails to find it

I get his error:

Chrome 38.0.2125 (Windows 7) ERROR
  Uncaught Not Found: C:/git_devel/zen/gui/zuiplugin_dll/app/js/Zen/Logging/log_deco
rator.js
  at C:/git_devel/zen/gui/zuiplugin_dll/node_modules/karma-jspm/src/adapter.js:47
Chrome 38.0.2125 (Windows 7): Executed 0 of 0 ERROR (0.003 secs / 0 secs)

I use commonJS module notation and when I try to require this module anywhere in my app. After I change the name of the file and require call to 'anything.js' it works flawlessly(or any other name I have tried).

A longer stack trace access on error on System.import

Hi

When files fail to be imported there is no information about the file path on the stack trace from the adapter. I usually gat :

Chrome 38.0.2125 (Linux) ERROR
  Uncaught ReferenceError: foo is not defined
  at /home/x/tmp/karma-jspm/src/adapter.js:47

It would be better to access to the it on the stack

Chrome 38.0.2125 (Linux) ERROR
  Uncaught ReferenceError: foo is not defined
  at /home/x/tmp/karma-jspm/src/adapter.js:47
  at Function.<anonymous> (http://localhost:9876/base/src/foo.js:3:20)

Any idea how to do it ?

Not working with typescript

Does not seem to work with typescript files. *.ts files get .js added to their path :

23 07 2015 23:55:18.363:WARN [karma]: No captured browser, open http://localhost:9876/
23 07 2015 23:55:18.370:INFO [karma]: Karma v0.13.3 server started at http://localhost:9876/
23 07 2015 23:55:18.373:INFO [launcher]: Starting browser PhantomJS
23 07 2015 23:55:19.279:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket yEG1qBR1xcB6RFh4AAAA with id 544981
23 07 2015 23:55:19.335:WARN [web-server]: 404: /src/app.ts.js
23 07 2015 23:55:19.336:WARN [web-server]: 404: /src/app.test.ts.js
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
  Error loading "src/app.ts" at http://localhost:9876/src/app.ts.js
  Not Found: http://localhost:9876/src/app.ts.js
  at undefined

https://github.com/kosz/karma-jspm-playground here is my setup

npm install && jspm install

npm start shows a server in which jspm loads ts files properly

also tried appending !

 jspm: {
  loadFiles: [
    'src/app.ts!',
    'src/app.test.ts!'
  ]
 },
24 07 2015 00:00:45.508:WARN [watcher]: Pattern "/src/jspmtest/src/app.ts!" does not match any file.
24 07 2015 00:00:45.510:WARN [watcher]: Pattern "src/jspmtest/src/app.test.ts!" does not match any file.
24 07 2015 00:00:45.625:WARN [karma]: No captured browser, open http://localhost:9876/
24 07 2015 00:00:45.632:INFO [karma]: Karma v0.13.3 server started at http://localhost:9876/
24 07 2015 00:00:45.635:INFO [launcher]: Starting browser PhantomJS
24 07 2015 00:00:46.536:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket pZ7HpzvF-szLqflyAAAA with id 41421504
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.001 secs / 0 secs)

karma-jspm and JetBrians WebStorm

Did anyone try to use WebStrom's test runner yet?

On the CLI everything works just fine. But if I use the karma.conf.js with WebStorm's test runner, it says Empty test suite.

Files in jspm_packages are ignored

Hi,

I want to test an aurelia.io project which uses jpsm. To be able to work with bluebird promises, I have to load its file before loading system.js in browser mode. So, in Karma, I have added its path in files array. But the file is not loaded because karma-jspm ignore all files located into jspm_package. I found a workaround by copying the bluebird.js file in another location. The file is now well loaded and my tests passes but I would prefer to keep my files in jspm_package folder. What can I do ?

karma run is broken with this plugin

If I run karma run using this plugin (karma start is OK) it crashes in this file (part of karma package):

node_modules/karma/lib/reporters/multi.js:

var helper = require('../helper');
var MultiReporter = function(reporters) {

  this.addAdapter = function(adapter) {
    reporters.forEach(function(reporter) {
      reporter.adapters.push(adapter); // CRASHES HERE
    });
  };

  this.removeAdapter = function(adapter) {
    reporters.forEach(function(reporter) {
      helper.arrayRemove(reporter.adapters, adapter);
    });
  };
};


// PUBLISH
module.exports = MultiReporter;

The error is that reporter.adapters is not defined. Patching karma's multi.js helps, but that's not the right place to fix.

PhantomJS fails to run with 6to5

When I run my tests I get an error with PhantomJS although Firefox and Chrome both work.

  Error loading "app/main" at /home/ryan/Workspace/launchbadge/paper/app/main.js
  Error loading "@6to5" at /home/ryan/Workspace/launchbadge/paper/jspm_packages/6to5.js
  Error evaluating /home/ryan/Workspace/launchbadge/paper/jspm_packages/6to5.js
  TypeError: 'undefined' is not a function (evaluating 're.test.bind(re)')
  at undefined

Repo is at https://github.com/launchbadge/paper

Unable to import JSON files

In my JSPM project I'm using the JSON plugin 'systemjs/plugin-json' to allow me to import JSON files into my scripts.

It seems that this isn't working with karma-jspm. I'm unsure of what I need to do to get these files loading. SystemJS under Karma is acting as if the plugin isn't loaded at all, appending .js to the end of the filenames.

Using angular-mocks

It seems that loading angular-mocks via JSPM does not expose globals such as module and inject. What is the recommended way to access them? The following works, but is there a different approach that is better?

var angular = require('angular');
require('angular-mocks');

describe('MyController', function() {
  beforeEach(angular.mock.module('MyApp'));
  beforeEach(angular.mock.inject(...));
  it(...);
});

Is this a deficiency in https://github.com/jspm/registry/blob/master/package-overrides/github/angular/bower-angular-mocks%401.3.0-beta.19.json ? Should it be exporting globals?

Code coverage with karma-jspm

I'm using karma-coverage along with karma-jspm. Coverage reports are being generated, but only for source files that are referenced in test files. However, any source files that are not required from a test file doesn't show up in the coverage report.

Is this is because karma-jspm highjacks the karam files config, only including files that are referenced? Any ideas on how to get the coverage reports to list all source files so the reporting is more accurate?

Here's relevant portions of my karma config:

  config.set({
    frameworks: ['jspm','mocha','sinon-chai'],
    jspm: {
      loadFiles: ['app/**/test/**/*.test.js'],
      serveFiles: ['app/**/lib/**/*.js']
    },
    proxies: {
      '/jspm_packages/': '/base/jspm_packages/'
    },
    preprocessors: {
      'app/**/lib/**/*.js': ['coverage']
    }
};

I've attempted to include both tests and source files in jspm.loadFiles, but it blows up with errors. These are errors I may be able to resolve, but wanted to first find out if there is a better approach I should be taking.

Help to Start

Could you guys please take a look at my simple example in which I have tried to use karma-jspm?

I can't load Parson class in test file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.