An open API service indexing awesome lists of open source software.

https://github.com/rxlabz/ngdart-component-testbed

example of angular dart component test with https://github.com/dart-lang/angular_test
https://github.com/rxlabz/ngdart-component-testbed

angular dart testing

Last synced: about 1 month ago
JSON representation

example of angular dart component test with https://github.com/dart-lang/angular_test

Awesome Lists containing this project

README

          

# angular_test example

## pubspec.yml

```yam
transformers:
- angular2/transform/codegen
- angular2/transform/reflection_remover:
$include:
- test/compo_test.dart
- test/pub_serve:
$include: test/**_test.dart
```

## compo_test.dart

```dart
@Tags(const ['aot'])
@TestOn('browser')

import 'package:angular2/core.dart';
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';

import 'package:angular2/src/modules/testing/lib/testing.dart';
import 'package:test/test.dart';
import 'package:xplor_ng_test_bed/compo/compo.dart';

@AngularEntrypoint()
void main(){
reflector.reflectionCapabilities = new ReflectionCapabilities();

tearDown(disposeAnyRunningTest);

group('test my compo',(){
test('1er test compo titre',() async {
final testBed = new NgTestBed();
final textFxtr = await testBed.create(onLoad:(c){
c.title = "Yo";
});

expect( textFxtr.element.innerHtml, contains('Yo') );
});

test('2nd test compo titre',() async {
final testBed = new NgTestBed();
final textFxtr = await testBed.create(onLoad:(c){
c.title = "Coucou";
});

expect( textFxtr.element.innerHtml, contains('Coucou') );
});
});
}
```

## compo_test.html

```html

```

## testing

```bash
pub run angular_test

# ou

pub serve # => localhost:8081/path_test.html

```