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


TypeScript task.bothPar函数代码示例

本文整理汇总了TypeScript中@jonggrang/task.bothPar函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bothPar函数的具体用法?TypeScript bothPar怎么用?TypeScript bothPar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: sendIfModifiedSince

 function sendIfModifiedSince(date: string) {
   const req = new IncomingMessageMock({
     url: '/attic/a',
     headers: {
       'If-Modified-Since': date
     }
   });
   return T.bothPar(fileDate, request(fileServer, req)).map(([mdate, resp]) => {
     assert.equal(resp.status, 200);
     assert.equal(resp.headers['Last-Modified'], mdate);
   });
 }
开发者ID:syaiful6,项目名称:jonggrang,代码行数:12,代码来源:static.test.ts

示例2: it

  it('can move file upload to target dir', async function () {
    const middleware = mutter({ getStorage });
    const form = new FormData();

    form.append('name', 'thatiq');
    form.append('tiny0', file('tiny0.json'));

    const { state } = await T.toPromise(submitForm(middleware, form));
    const dest = await T.toPromise(T.node(null, temp.mkdir));
    const files: Files = state.files;
    const target = path.join(dest, 'tiny-uploaded.json');
    await T.toPromise(files['tiny0'][0].move(target));
    const [targetStat, sourceStat] = await T.toPromise(T.bothPar(
      T.node(null, target, fs.stat),
      T.node(null, path.join(__dirname, 'fixtures', 'tiny0.json'), fs.stat)
    ));
    assert.equal(targetStat.size, sourceStat.size);
    await T.toPromise(T.node(null, dest, rimraf));
  });
开发者ID:syaiful6,项目名称:jonggrang,代码行数:19,代码来源:disk-storage.ts

示例3:

export async function tdeepEq<A>(t: T.Task<A>, t2: T.Task<A>): Promise<void> {
  const [a, b] = await T.toPromise(T.bothPar(t, t2));
  assert.deepEqual(a, b);
}
开发者ID:syaiful6,项目名称:jonggrang,代码行数:4,代码来源:utils.ts

示例4: it

 it('randomString can generate random string', () =>
   shouldBe([32, 22], T.bothPar(
     Crypt.randomString(32),
     Crypt.randomString(22)
   ).map(xs => xs.map(x => x.length)))
开发者ID:syaiful6,项目名称:jonggrang,代码行数:5,代码来源:index.ts


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