本文整理汇总了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');
});
示例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');
});
示例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);
});
示例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,
);
});
示例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,
);
});
示例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();
},
});
});
示例7:
return handle.result().then((result) => {
assert.equal(result.data['luke'].name, 'Luke Skywalker');
assert.notProperty(result.data, 'vader');
});