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
- Host: GitHub
- URL: https://github.com/rxlabz/ngdart-component-testbed
- Owner: rxlabz
- Created: 2017-02-07T13:47:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T14:03:48.000Z (over 9 years ago)
- Last Synced: 2025-03-09T15:08:49.729Z (over 1 year ago)
- Topics: angular, dart, testing
- Language: Dart
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```