1

We're working on an aurelia-based app using typescript.

For our test setup we use jasmine, and karma + wallby for our testrunnes. Wallaby for development (due to the ide integration), and karma for buildserver tests.

Recently we took in a dependency on an ES5 package (momentjs). Our two testrunners seem to want diffrent import statements for the same module.

Wallaby wants it like this: import * as moment from 'moment'; Karma wants it like this: import moment from 'moment'; Running the actual app in the browser works fine with either.

Why do they want different syntax for the same module? How can i get the two testrunners to unite on one import syntax?

More info on our setup:
Relevant tsconfig.json:
"target": "es5", "module": "amd", "moduleResolution": "node",

Both testrunners load typescript and does its own transpiling, I assume with the same global tsconfig.json as above.
Module loading using SystemJs and jspm(0.16).

yacuzo
  • 21
  • 3
  • I can't reproduce the issue. Perhaps you're importing the module from different locations? If I run `jspm install npm:moment`, both runners work identically for me. If you create a sample where the issue is reproducible and share it at https://github.com/wallabyjs/public/issues, I'm happy to have a look. – Artem Govorov Jun 28 '16 at 11:52
  • 1
    Thanks for the reply. [Skeleton-project](http://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript) has the same problem. Momentjs seems to struggle with handling the transition to ES6([github issue](http://github.com/moment/moment/issues/2608)), so I'll go with a dirty workaround for now: Karma preprocessor to change the import statements. – yacuzo Jun 29 '16 at 13:50

0 Answers0