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


TypeScript assert.equal方法代码示例

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


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

示例1: it

 it("fileSize", () => {
   assert.equal(fileSize(1023), "1023 B");
   assert.equal(fileSize(234090), "229 KiB");
   assert.equal(fileSize(6934028), "6.6 MiB");
   assert.equal(fileSize(239502889), "228 MiB");
   assert.equal(fileSize(2395028891), "2.2 GiB");
 });
开发者ID:itchio,项目名称:itch,代码行数:7,代码来源:filesize.spec.ts

示例2: it

 it("camelify", () => {
   assert.equal(camelify("underscore"), "underscore");
   assert.equal(camelify("under score"), "under score");
   assert.equal(camelify("under_score"), "underScore");
   assert.equal(camelify("heed_the_call"), "heedTheCall");
   assert.equal(camelify("_sorry"), "Sorry");
 });
开发者ID:itchio,项目名称:itch,代码行数:7,代码来源:camelify.spec.ts

示例3: it

 it("truncate", () => {
   assert.equal(truncate("hello", { length: 10 }), "hello");
   assert.equal(
     truncate("hello my friend this is a Nigerian prince and I", {
       length: 10,
     }),
     "hello m..."
   );
 });
开发者ID:HorrerGames,项目名称:itch,代码行数:9,代码来源:truncate.spec.ts

示例4: it

  it("formatDate", () => {
    const refString = "April 3, 1994, 11:47:21";

    assert.equal(formatDate(null, "en", DATE_FORMAT), "");
    assert.equal(formatDate(new Date("haha"), "en", DATE_FORMAT), "Ø");
    assert.equal(
      formatDate(new Date("1994-04-03 11:47:21 +0"), "en", DATE_FORMAT),
      refString
    );
    assert.equal(
      formatDate(new Date("1994-04-03 11:47:21 +0"), "en-US", DATE_FORMAT),
      refString
    );
  });
开发者ID:itchio,项目名称:itch,代码行数:14,代码来源:datetime.spec.ts

示例5: it

 it("price", () => {
   assert.equal(formatPrice("USD", 1500), "$15.00");
   assert.equal(formatPrice("CAD", 60), "CAD $0.60");
   assert.equal(formatPrice("AUD", 75.1), "AUD $0.75");
   assert.equal(formatPrice("GBP", 1000), "£10.00");
   assert.equal(formatPrice("EUR", 2000), "20.00 €");
   assert.equal(formatPrice("JPY", 1500), "¥1500.00");
   assert.equal(formatPrice("BLORGONS", 100), "$1.00");
 });
开发者ID:HorrerGames,项目名称:itch,代码行数:9,代码来源:price.spec.ts

示例6: it

  it("Context propagates progress", async () => {
    const c = new Context(store);

    let p1 = 0;
    let p2 = 0;
    c.on("progress", info => {
      p1 = info.progress;
    });
    c.on("progress", info => {
      p2 = info.progress;
    });

    assert.equal(p1, 0);
    assert.equal(p2, 0);

    c.emitProgress({ progress: 0.5 });

    assert.equal(p1, 0.5);
    assert.equal(p2, 0.5);
  });
开发者ID:itchio,项目名称:itch,代码行数:20,代码来源:index.spec.ts

示例7: it

 it("formats a french string", () => {
   const i18n = {
     lang: "fr",
     strings: {
       fr: {
         "hello.there": "Bonjour, {name}",
       },
     },
     queued: null as any,
     downloading: null as any,
     locales: null as any,
   };
   assert.equal(t(i18n, ["hello.there", { name: "Brock" }]), "Bonjour, Brock");
 });
开发者ID:itchio,项目名称:itch,代码行数:14,代码来源:t.spec.ts


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