当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Logger.sync方法代码示例

本文整理汇总了TypeScript中@ephox/agar.Logger.sync方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.sync方法的具体用法?TypeScript Logger.sync怎么用?TypeScript Logger.sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/agar.Logger的用法示例。


在下文中一共展示了Logger.sync方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 const assertSome = (label: string, expected: DialogDelta, previousText: string, catalog: ListItem[], data: Partial<LinkDialogData>) => {
   Logger.sync('assertSome(' + label + ')', () => {
     const actual = DialogChanges.getDelta(previousText, 'anchor', catalog, data);
     RawAssertions.assertEq('Checking replacement text', expected, actual.getOrDie(
       'Should be some'
     ));
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:DialogChangesTest.ts

示例2: Error

 const assertNone = (label: string, previousText: string, catalog: ListItem[], data: Partial<LinkDialogData>) => {
   Logger.sync('assertNone(' + label + ')', () => {
     const actual = DialogChanges.getDelta(previousText, 'anchor', catalog, data);
     actual.each(
       (a) => { throw new Error('Should not have found replacement text'); }
     );
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:DialogChangesTest.ts

示例3: method

      const test = (label: string, method: (editor: Editor) => string, settings: any, expected: string) => {
        const mockEditor = {
          getParam: (name, defaultValue) => Obj.get(settings, name).getOr(defaultValue),
          settings
        } as any;

        Logger.sync(label, () => {
          const result = method(mockEditor);
          RawAssertions.assertEq(label, expected, result);
        });
      };
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:EditorSettingsTest.ts

示例4: function

  const checkGetALink = function (rawScenario) {
    const schema = ValueSchema.objOfOnly([
      FieldSchema.strict('label'),
      FieldSchema.defaulted('linkHtml', ''),
      FieldSchema.defaulted('selection', ''),
      FieldSchema.strict('expected')
    ]);

    const scenario = ValueSchema.asRawOrDie(rawScenario.label, schema, rawScenario);

    Logger.sync('getInfo ... ' + scenario.label + ', link: ' + scenario.linkHtml, function () {
      editorState.start.set(Element.fromHtml(scenario.linkHtml).dom());
      editorState.content.set(scenario.selection);
      const info = LinkBridge.getInfo(editor);
      RawAssertions.assertEq('Checking getInfo (link)', scenario.expected, Objects.narrow(info, [ 'url', 'text', 'target', 'title' ]));
      RawAssertions.assertEq('Checking link is set', true, info.link.isSome());
    });
  };
开发者ID:abstask,项目名称:tinymce,代码行数:18,代码来源:LinkBridgeTest.ts

示例5: function

  const checkApply = function (rawScenario) {
    const toResult = (info, param) => Option.from(info[param]).fold(() => Result.error('Missing ' + param), Result.value);
    const scenario = {
      label: Option.from(rawScenario.label).getOrDie('Missing label'),
      info: Option.from(rawScenario.info).map((info) => ({
        url: toResult(info, 'url'),
        text: toResult(info, 'text'),
        title: toResult(info, 'title'),
        target: toResult(info, 'target'),
        link: toResult(info, 'link'),
      })).getOrDie('Missing info'),
      mutations: Option.from(rawScenario.mutations).getOr(Fun.noop),
      expected: Option.from(rawScenario.expected).getOr([]),
    };

    Logger.sync('setInfo ... ' + scenario.label, function () {
      store.clear();
      LinkBridge.applyInfo(editor, scenario.info);
      store.assertEq('Checking store', scenario.expected);
      const link = scenario.info.link.bind(Fun.identity);
      link.each(scenario.mutations);
    });
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:23,代码来源:LinkBridgeTest.ts


注:本文中的@ephox/agar.Logger.sync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。