本文整理汇总了TypeScript中chai.assert.isString方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isString方法的具体用法?TypeScript assert.isString怎么用?TypeScript assert.isString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.isString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return identical hash for same object', () => {
var ori = xm.jsonToIdent(valueA);
var alt = xm.jsonToIdent(valueA);
assert.isString(ori, 'ori');
assert.isString(alt, 'alt');
assert.strictEqual(ori, alt);
});
示例2: it
it('exports packageInfo', () => {
assert.isObject(ctx.packageInfo, 'packageInfo');
assert.instanceOf(ctx.packageInfo, xm.PackageJSON, 'config');
assert.isString(ctx.packageInfo.name, 'name');
assert.isString(ctx.packageInfo.version, 'version');
assert.isObject(ctx.packageInfo.raw, 'pkg');
});
示例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:
var actual = xm.reduceHash(input, [], (memo:number[], elem:number, prop:string, collection) => {
memo = memo.slice(0);
memo.push(elem * elem);
assert.isString(prop, 'prop');
assert.equal(input, collection, 'collection');
return memo;
});
示例5: assertPoint
response.forEach((data) => {
assertPoint(data);
assert.include(data.name, "Frauenkirche");
assert.strictEqual(data.city, "Dresden");
assert.isString(data.id);
assertCoords(data.coords);
assert.oneOf(data.type, Object.keys(dvb.POI_TYPE));
});
示例6: getInfo
function getInfo(name:string):helper.HttpTest {
assert.isString(name, 'name');
var info = new helper.HttpTest();
info.storeTmpDir = path.join(helper.getDirNameTmp(), name);
info.storeFixtureDir = path.join(helper.getDirNameFixtures(), name);
info.wwwHTTP = 'http://localhost:9090/';
info.wwwDir = path.resolve(helper.getDirNameTmp(), '..', 'www');
return info;
}
示例7: it
it('should return some proper html', function () {
const html = ServerRenderer.render(store.createDefault({log: false}));
assert.isString(html, "The rendered HTML needs to be a string");
assert.include(html, '<div', 'rendered HTML contains at least an open div');
assert.include(html, '</div>', 'rendered HTML contains at least an closed div');
// TODO: Make assumptions about the state in store.getState();
});
示例8: 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);
}
}