本文整理匯總了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");
});