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


TypeScript assert.notProperty方法代码示例

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


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

示例1: it

    it('should map to entities with empty object', () => {
      let entity = getHydrator().fromSchema({
        name: 'foo',
      }, {});

      assert.notProperty(entity, 'name');
    });
开发者ID:RWOverdijk,项目名称:wetland,代码行数:7,代码来源:Hydrator.spec.ts

示例2:

      .then((newResult: any) => {
        // There should be one fewer todo item than before
        assert.equal(newResult.data.todoList.todos.length, 2);

        // The item shouldn't be in the store anymore
        assert.notProperty(client.queryManager.getApolloState().data, 'Todo3');
      });
开发者ID:Vanuan,项目名称:apollo-client,代码行数:7,代码来源:mutationResults.ts

示例3:

      .then((newResult: any) => {
        // There should be one fewer todo item than before
        assert.equal(newResult.data.todoList.todos.length, 2);

        // The item shouldn't be in the store anymore
        assert.notProperty(client.queryManager.getApolloState().data, 'Todo3');
        // shouldn't have affected other data elements
        assert.notEqual(client.queryManager.getApolloState().data['TodoList5']['__typename'], undefined);
      });
开发者ID:drager,项目名称:apollo-client,代码行数:9,代码来源:mutationResults.ts

示例4: setTimeout

 p.then(() => {
   assert.lengthOf(fetchMock.calls(url), 1);
   assert.lengthOf(_.keys(state), 2);
   assert.equal(state[uiKey1].state, uidata.UIDataState.LOADING);
   assert.equal(state[uiKey2].state, uidata.UIDataState.LOADING);
   assert.isUndefined(state[uiKey1].data);
   assert.isUndefined(state[uiKey2].data);
   assert.notProperty(state[uiKey1], "data");
   assert.notProperty(state[uiKey2], "data");
   assert.isUndefined(state[uiKey1].error);
   assert.isUndefined(state[uiKey2].error);
   setTimeout(
     () => {
       assert.equal(state[uiKey1].state, uidata.UIDataState.LOAD_ERROR);
       assert.equal(state[uiKey2].state, uidata.UIDataState.LOAD_ERROR);
       assert.instanceOf(state[uiKey1].error, Error);
       assert.instanceOf(state[uiKey2].error, Error);
       done();
     },
     1000,
   );
 });
开发者ID:Yogendrovich,项目名称:cockroach,代码行数:22,代码来源:uiData.spec.ts

示例5: setTimeout

 p.then(() => {
   assert.lengthOf(fetchMock.calls(`${api.API_PREFIX}/uidata`), 1);
   assert.lengthOf(_.keys(state), 2);
   assert.equal(state[uiKey1].status, uidata.UIDataStatus.SAVING);
   assert.equal(state[uiKey2].status, uidata.UIDataStatus.SAVING);
   assert.isUndefined(state[uiKey1].data);
   assert.isUndefined(state[uiKey2].data);
   assert.notProperty(state[uiKey1], "data");
   assert.notProperty(state[uiKey2], "data");
   assert.isUndefined(state[uiKey1].error);
   assert.isUndefined(state[uiKey2].error);
   setTimeout(
     () => {
       assert.equal(state[uiKey1].status, uidata.UIDataStatus.SAVE_ERROR);
       assert.equal(state[uiKey2].status, uidata.UIDataStatus.SAVE_ERROR);
       assert.instanceOf(state[uiKey1].error, Error);
       assert.instanceOf(state[uiKey2].error, Error);
       done();
     },
     1000,
   );
 });
开发者ID:a6802739,项目名称:cockroach,代码行数:22,代码来源:uiData.spec.ts

示例6: it

  it('empty error array (handle non-spec-compliant server) #156', (done) => {
    const query = gql`
      query people {
        allPeople(first: 1) {
          people {
            name
          }
        }
      }
    `;

    const networkInterface = mockNetworkInterface(
      {
        request: {query },
        result: {
          data: {
            allPeople: {
              people: {
                name: 'Ada Lovelace',
              },
            },
          },
          errors: [],
        },
      }
    );

    const queryManager = new QueryManager({
      networkInterface,
      store: createApolloStore(),
      reduxRootKey: 'apollo',
    });

    const handle = queryManager.watchQuery({
      query,
    });

    handle.subscribe({
      next(result) {
        assert.equal(result.data['allPeople'].people.name, 'Ada Lovelace');
        assert.notProperty(result, 'errors');
        done();
      },
    });
  });
开发者ID:ignitedsgn,项目名称:apollo-client,代码行数:45,代码来源:QueryManager.ts

示例7:

 return handle.result().then((result) => {
   assert.equal(result.data['luke'].name, 'Luke Skywalker');
   assert.notProperty(result.data, 'vader');
 });
开发者ID:CoericK,项目名称:apollo-client,代码行数:4,代码来源:QueryManager.ts


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