computmaxer / karma-jspm

Other
74 stars 50 forks source link

Problem referencing exported class from spec #45

Closed kristianmandrup closed 9 years ago

kristianmandrup commented 9 years ago

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

kristianmandrup commented 9 years ago

Due to this bad import without relative prefix indicator './' n another file :P Damn!

import {BindTable} from './bindtable';