chore(transformer): add tests for property bindings and multiple executions
This commit is contained in:
@@ -92,6 +92,18 @@ void allTests() {
|
||||
output = await process(new AssetId('a', inputPath));
|
||||
_formatThenExpectEquals(output, expected);
|
||||
});
|
||||
|
||||
it('should create the same output for multiple calls.', () async {
|
||||
var inputPath =
|
||||
'template_compiler/inline_expression_files/hello.ng_deps.dart';
|
||||
var expected = readFile(
|
||||
'template_compiler/inline_expression_files/expected/hello.ng_deps.dart');
|
||||
var output = await process(new AssetId('a', inputPath));
|
||||
_formatThenExpectEquals(output, expected);
|
||||
output = await process(new AssetId('a', inputPath));
|
||||
_formatThenExpectEquals(output, expected);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -14,9 +14,13 @@ void initReflector(reflector) {
|
||||
'parameters': const [const []],
|
||||
'annotations': const [
|
||||
const Component(selector: 'hello-app'),
|
||||
const View(template: '{{greeting}}')
|
||||
const View(template: '<div [a]="b">{{greeting}}</div>')
|
||||
]
|
||||
})
|
||||
..registerGetters({'greeting': (o) => o.greeting})
|
||||
..registerSetters({'greeting': (o, v) => o.greeting = v});
|
||||
..registerGetters({'b': (o) => o.b, 'greeting': (o) => o.greeting})
|
||||
..registerSetters({
|
||||
'b': (o, v) => o.b = v,
|
||||
'greeting': (o, v) => o.greeting = v,
|
||||
'a': (o, v) => o.a = v
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ void initReflector(reflector) {
|
||||
'parameters': const [const []],
|
||||
'annotations': const [
|
||||
const Component(selector: 'hello-app'),
|
||||
const View(template: '{{greeting}}')
|
||||
const View(template: '<div [a]="b">{{greeting}}</div>')
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user