本文整理汇总了TypeScript中glimmer-test-helpers.equalTokens函数的典型用法代码示例。如果您正苦于以下问题:TypeScript equalTokens函数的具体用法?TypeScript equalTokens怎么用?TypeScript equalTokens使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了equalTokens函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test("changing dynamic scope derived from another keyword from the outer scope", assert => {
let template = compile("{{view.name}} {{#with-keywords view=view.innerView}}{{view.name}}{{/with-keywords}} {{view.name}}");
let innerView = { name: 'Yehuda' };
let view = { name: 'Godfrey', innerView };
let viewRef = new UpdatableReference(view);
render(template, { innerView }, viewRef);
equalTokens(root, 'Godfrey Yehuda Godfrey', "Initial render");
rerender();
equalTokens(root, 'Godfrey Yehuda Godfrey', "Noop rerender");
innerView.name = 'Tom';
rerender();
equalTokens(root, 'Godfrey Tom Godfrey', "Update with mutation");
view.name = 'Godhuda';
rerender();
equalTokens(root, 'Godhuda Tom Godhuda', "Update with mutation");
viewRef.update({ name: 'Godfrey', innerView: { name: 'Yehuda' } });
rerender();
equalTokens(root, 'Godfrey Yehuda Godfrey', "Reset with replacement");
});