本文整理汇总了TypeScript中chai.assert.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isNotEmpty方法的具体用法?TypeScript assert.isNotEmpty怎么用?TypeScript assert.isNotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.isNotEmpty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: assertPin
.then((data) => {
assert.isNotEmpty(data);
data.forEach((pin) => assertPin(pin));
const poi = data.filter((pin) => pin.type === dvb.PIN_TYPE.poi);
const ticketmachine = data.filter(
(pin) => pin.type === dvb.PIN_TYPE.ticketmachine
);
const stop = data.filter((pin) => pin.type === dvb.PIN_TYPE.stop);
assert.isNotEmpty(poi);
assert.isNotEmpty(ticketmachine);
assert.isNotEmpty(stop);
assert.strictEqual(
poi.length + ticketmachine.length + stop.length,
data.length
);
}));
示例2: it
it("convertCoordinates", () => {
const points = utils.convertCoordinates(
`${gk4[0]}|${gk4[1]}|${gk4[0]}|${gk4[1]}|`
);
assert.isNotEmpty(points);
points.forEach(assertCoords);
});
示例3: assertPin
export function assertPin(pin: IPin, type?: PIN_TYPE) {
assert.isObject(pin);
assertNotEmptyString(pin.type);
if (type) {
assert.strictEqual(pin.type, type);
}
assertNotEmptyString(pin.name);
assertCoords(pin.coords);
if (pin.type === PIN_TYPE.platform) {
assert.isString(pin.id);
assertNotEmptyString(pin.platform_nr);
} else {
assertNotEmptyString(pin.id);
assert.isUndefined(pin.platform_nr);
}
if (pin.type === PIN_TYPE.stop) {
assert.isArray(pin.connections);
if (pin.name !== "Ebertplatz") {
assert.isNotEmpty(pin.connections);
}
pin.connections!.forEach(assertConnection);
} else {
assert.isUndefined(pin.connections);
}
if (pin.type === PIN_TYPE.parkandride) {
assertNotEmptyString(pin.info);
} else {
assert.isUndefined(pin.info);
}
}
示例4: it
it('read', async () => {
const diceWare = (await DiceWareDispatcher.get())[0];
assert.isNotEmpty(diceWare.fname);
assert.isTrue(diceWare.diceCount == 5);
assert.isTrue(diceWare.diceWare.size > 100);
assert.isTrue(!!Array.from(diceWare.diceWare.values()).find(d => d.password == 'voice'));
});
示例5: assertPoint
dvb.findStop("Markt").then((data) => {
assert.isNotEmpty(data);
data.forEach((point) => {
assertPoint(point);
assert.strictEqual(point.type, dvb.POI_TYPE.Stop);
});
}));
示例6: it
it('persists original errors without a result', () => {
const result = {
errors: [new GraphQLError('Test error')]
};
try {
checkResultAndHandleErrors(result, {} as GraphQLResolveInfo, 'responseKey');
} catch (e) {
assert.equal(e.message, 'Test error');
assert.isNotEmpty(e.originalError);
assert.isNotEmpty(e.originalError.errors);
assert.lengthOf(e.originalError.errors, result.errors.length);
result.errors.forEach((error, i) => {
assert.deepEqual(e.originalError.errors[i], error);
});
}
});
示例7: assertNode
function assertNode(node: INode) {
assert.isString(node.direction);
assert.isNumber(node.duration);
assertMode(node.mode);
if (
node.mode.name !== "Footpath" &&
node.mode.name !== "StayForConnection" &&
node.mode.name.indexOf("Stairs") === -1
) {
assert.isDefined(node.diva);
assertDiva(node.diva!);
assertNotEmptyString(node.line);
} else {
assert.isUndefined(node.diva);
assert.isString(node.line);
}
if (
(node.mode.name === "Footpath" && !node.departure) ||
node.mode.name.indexOf("Stairs") > -1
) {
assert.isUndefined(node.departure);
assert.isUndefined(node.arrival);
assert.isArray(node.stops);
assert.isEmpty(node.stops);
} else {
assertStopLocation(node.departure!);
assertStopLocation(node.arrival!);
assert.isArray(node.stops);
assert.isNotEmpty(node.stops);
node.stops.forEach(assertStop);
}
assert.isArray(node.path);
if (node.mode.name !== "StayForConnection") {
assert.isNotEmpty(node.path);
node.path.forEach(assertCoords);
} else {
assert.isEmpty(node.path);
}
}
示例8: it
it("node duration should not always be 0", () => {
assert.isNotEmpty(data.trips);
data.trips.forEach((trip) => {
let durationSum = 0;
trip.nodes.forEach((node) => {
durationSum += node.duration;
});
assert.notEqual(0, durationSum);
});
});