• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript expect.js类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: it

    it('fill correct data - no errors', function () {

        //when
        this.Data.Contacts.push(getItemDataTemplate());
        this.Data.Contacts.push(getItemDataTemplate());
        this.Data.Contacts.push(getItemDataTemplate());

        //excercise
        var result = this.MainValidator.Validate(this.Data);
        //verify
        expect(result.HasErrors).to.equal(false);

    });
开发者ID:rsamec,项目名称:business-rules-engine,代码行数:13,代码来源:formSchema.ts


示例2: async

  const createExpectSpaceAwareResults = (spaceId = DEFAULT_SPACE_ID) => async (resp: {
    [key: string]: any;
  }) => {
    expect(resp.body)
      .to.have.property('id')
      .match(/^[0-9a-f-]{36}$/);

    // loose ISO8601 UTC time with milliseconds validation
    expect(resp.body)
      .to.have.property('updated_at')
      .match(/^[\d-]{10}T[\d:\.]{12}Z$/);

    expect(resp.body).to.eql({
      id: resp.body.id,
      type: spaceAwareType,
      updated_at: resp.body.updated_at,
      version: 1,
      attributes: {
        title: 'My favorite vis',
      },
    });

    const expectedSpacePrefix = spaceId === DEFAULT_SPACE_ID ? '' : `${spaceId}:`;

    // query ES directory to ensure namespace was or wasn't specified
    const { _source } = await es.get({
      id: `${expectedSpacePrefix}${spaceAwareType}:${resp.body.id}`,
      type: 'doc',
      index: '.kibana',
    });

    const { namespace: actualNamespace } = _source;

    if (spaceId === DEFAULT_SPACE_ID) {
      expect(actualNamespace).to.eql(undefined);
    } else {
      expect(actualNamespace).to.eql(spaceId);
    }
  };
开发者ID:liuyepiaoxiang,项目名称:kibana,代码行数:39,代码来源:create.ts


示例3: it

        it('fill incorrect data - some errors', function () {

            //when
            this.Data.Checked = true;
            this.Data.FirstName = "John Junior";
            this.Data.LastName = "Smith";

            //excercise
            var result = this.PersonValidator.Validate(this.Data);

            //verify
            expect(result.HasErrors).to.equal(true);
        });
开发者ID:rsamec,项目名称:business-rules-engine,代码行数:13,代码来源:rules.ts


示例4: done

 jobs.jobs({ name: 'jobA', data: 'someData' }, (err, j) =>  {
     if (err) {
         return done(err);
     }
     expect(j).to.have.length(0);
     jobs.jobs({ name: 'jobA' }, (err, j) =>  {
         if (err) {
             return done(err);
         }
         expect(j).to.have.length(1);
         done();
     });
 });
开发者ID:cdbajorin,项目名称:typed-agenda,代码行数:13,代码来源:agenda.ts


示例5: expect

 const createExpectNotSpaceAwareResults = (spaceId = DEFAULT_SPACE_ID) => (resp: {
   [key: string]: any;
 }) => {
   expect(resp.body).to.eql({
     id: `${notSpaceAwareId}`,
     type: 'globaltype',
     updated_at: '2017-09-21T18:59:16.270Z',
     version: resp.body.version,
     attributes: {
       name: 'My favorite global object',
     },
   });
 };
开发者ID:liuyepiaoxiang,项目名称:kibana,代码行数:13,代码来源:get.ts


示例6: it

            it('fill two items', function () {
                //when
                data.Hobbies = [
                    {HobbyName: "Skiing"},
                    {HobbyName: 'Chess'}
                ]

                //exec
                var result = businessRules.Validate(data);

                //verify
                expect(result.Errors["Hobbies"].HasErrors).to.equal(false)
            });
开发者ID:rsamec,项目名称:business-rules,代码行数:13,代码来源:hobbiesSchema.ts


示例7: it

 it('should set members by parameters', () => {
     expect(chrobject).to.be.ok();
     expect(chrobject.entity).to.be.ok();
     expect(chrobject.entity).to.eql(entity);
     expect(chrobject.config).to.eql(config);
     expect(chrobject.appService).to.be.ok();
     expect(chrobject.appService).to.eql(new EntryAppService(entity, storage, options));
 });
开发者ID:hydra-newmedia,项目名称:chrobject,代码行数:8,代码来源:ChrobjectTest.ts


示例8: it

  it("add first party caveat 3 times", function () {

    // given
    var m = new MacaroonsBuilder(location, secret, identifier)
        .add_first_party_caveat("account = 3735928559")
        .add_first_party_caveat("time < 2015-01-01T00:00")
        .add_first_party_caveat("email = [email protected]")
        .getMacaroon();

    expect(m.location).to.be(location);
    expect(m.identifier).to.be(identifier);
    expect(m.caveatPackets[0].type).to.be(CaveatPacketType.cid);
    expect(m.caveatPackets[0].getValueAsText()).to.be("account = 3735928559");
    expect(m.caveatPackets[1].type).to.be(CaveatPacketType.cid);
    expect(m.caveatPackets[1].getValueAsText()).to.be("time < 2015-01-01T00:00");
    expect(m.caveatPackets[2].type).to.be(CaveatPacketType.cid);
    expect(m.caveatPackets[2].getValueAsText()).to.be("email = [email protected]");
    expect(m.signature).to.be("882e6d59496ed5245edb7ab5b8839ecd63e5d504e54839804f164070d8eed952");
  });
开发者ID:cmbankester,项目名称:macaroons.js,代码行数:19,代码来源:MacaroonsBuilderCaveatsTest.ts


示例9: it

 it('should set entity and storage members', () => {
     eas = new EntryAppService(entity, storage, options);
     expect(eas instanceof EntryAppService).to.be.ok();
     expect(eas.entity).to.be.ok();
     expect(eas.entity).to.eql(entity);
     expect(eas.storage).to.be.ok();
     expect(eas.storage).to.eql(storage);
     expect(eas.options).to.be.ok();
     expect(eas.options).to.eql({
         ignoreProperties: ['data.ignored'], ignoreSubProperties: []
     });
 });
开发者ID:hydra-newmedia,项目名称:chrobject,代码行数:12,代码来源:EntryAppServiceTest.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript expo-core.EventEmitter类代码示例发布时间:2022-05-25
下一篇:
TypeScript expect.setState函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap