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


TypeScript assert.isString方法代码示例

本文整理汇总了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);
		});
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:7,代码来源:hash.ts

示例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');
		});
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:7,代码来源:Context.ts

示例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);
  }
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:35,代码来源:helper.ts

示例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;
			});
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:7,代码来源:iterate.ts

示例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));
 });
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:8,代码来源:index.spec.ts

示例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;
	}
开发者ID:HansS,项目名称:tsd,代码行数:9,代码来源:HTTPCache.ts

示例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();
        });
开发者ID:Niondir,项目名称:iot-dashboard,代码行数:9,代码来源:serverRenderer.test.ts

示例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);
  }
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:44,代码来源:helper.ts


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