chore: karma with JS, Dart

Note: karma with dart is still not working
because of how `karma-dart` loads `package:…` dependencies.

Usage:
```
karma start karma-js.conf.js
karma start karma-dart.conf.js
```

Make sure to set `DARTIUM_BIN` env variable.

Refactors `js2dart`:
- live outside of the traceur module (`tools/js2dart/index.js`)
  so it can be reused by gulp and karma
- automatically build the sources in memory,
  so that `js2dart` can be used without running `gulp build` first
- provide a way to specify the moduleName of a compilation run
  independently of the input filename. This helps error messages
  and source maps (not yet enabled) to report the correct file name

Changes project setup:
- add module `test_lib` that contains the primitives for tests
  (e.g. `describe`, `it`, …)
- clean up some sources that had errors in them
- module names in transpiled js and dart files don’t contain
  `lib`, `test` nor `src` any more (e.g. `di/di`).
This commit is contained in:
Vojta Jina
2014-09-25 14:04:46 -07:00
committed by Tobias Bosch
parent 6335fc407c
commit c3b442ea53
26 changed files with 335 additions and 235 deletions

View File

@ -1,6 +1,7 @@
import {describe, id} from 'spec/spec';
import {describe, id} from 'test_lib/test_lib';
import {Compiler} from './compiler';
function main() {
export function main() {
describe('compiler', () => {
it('should hello', () => {
print('I am working');