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:
@ -3,4 +3,5 @@ environment:
|
||||
sdk: '>=1.4.0'
|
||||
dependencies:
|
||||
dev_dependencies:
|
||||
unittest: '>=0.10.1 <0.12.0'
|
||||
test_lib:
|
||||
path: ../test_lib
|
||||
|
@ -9,4 +9,5 @@ dependencies:
|
||||
facade:
|
||||
path: ../facade
|
||||
dev_dependencies:
|
||||
unittest: '>=0.10.1 <0.12.0'
|
||||
test_lib:
|
||||
path: ../test_lib
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Future} from 'facade/lang';
|
||||
import {Future, Type} from 'facade/lang';
|
||||
import {Element} from 'facade/dom';
|
||||
import {ProtoView} from '../view/proto_view';
|
||||
import {TemplateLoader} from './template_loader';
|
||||
|
@ -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');
|
||||
|
@ -5,4 +5,5 @@ dependencies:
|
||||
facade:
|
||||
path: ../facade
|
||||
dev_dependencies:
|
||||
unittest: '>=0.10.1 <0.12.0'
|
||||
test_lib:
|
||||
path: ../test_lib
|
||||
|
3
modules/di/src/key.js
Normal file
3
modules/di/src/key.js
Normal file
@ -0,0 +1,3 @@
|
||||
export class Key {
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import {Type} from 'facade/lang';
|
||||
import {Map, MapWrapper wraps Map} from 'facade/collection';
|
||||
import {Key} from './key';
|
||||
|
||||
/// becouse we need to know when toValue was not set.
|
||||
/// (it could be that toValue is set to null or undefined in js)
|
||||
|
@ -3,4 +3,5 @@ environment:
|
||||
sdk: '>=1.4.0'
|
||||
dependencies:
|
||||
dev_dependencies:
|
||||
unittest: '>=0.10.1 <0.12.0'
|
||||
test_lib:
|
||||
path: ../test_lib
|
||||
|
@ -3,4 +3,5 @@ environment:
|
||||
sdk: '>=1.4.0'
|
||||
dependencies:
|
||||
dev_dependencies:
|
||||
unittest: '>=0.10.1 <0.12.0'
|
||||
test_lib:
|
||||
path: ../test_lib
|
||||
|
6
modules/test_lib/pubspec.yaml
Normal file
6
modules/test_lib/pubspec.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
name: test_lib
|
||||
environment:
|
||||
sdk: '>=1.4.0'
|
||||
dependencies:
|
||||
dev_dependencies:
|
||||
guinness: ">=0.1.5 <0.2.0"
|
1
modules/test_lib/src/test_lib.dart
Normal file
1
modules/test_lib/src/test_lib.dart
Normal file
@ -0,0 +1 @@
|
||||
export 'package:guinness/guinness.dart' show describe, it, beforeEach, afterEach, expect;
|
8
modules/test_lib/src/test_lib.es6
Normal file
8
modules/test_lib/src/test_lib.es6
Normal file
@ -0,0 +1,8 @@
|
||||
export var describe = window.describe;
|
||||
export var it = window.it;
|
||||
export var beforeEach = window.beforeEach;
|
||||
export var afterEach = window.afterEach;
|
||||
export var expect = window.expect;
|
||||
|
||||
// To make testing consistent between dart and js
|
||||
window.print = window.dump || window.console.log;
|
Reference in New Issue
Block a user