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


TypeScript assert.isNotEmpty方法代码示例

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

示例2: it

 it("convertCoordinates", () => {
   const points = utils.convertCoordinates(
     `${gk4[0]}|${gk4[1]}|${gk4[0]}|${gk4[1]}|`
   );
   assert.isNotEmpty(points);
   points.forEach(assertCoords);
 });
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:7,代码来源:utils.spec.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: 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'));
 });
开发者ID:mabels,项目名称:clavator,代码行数:7,代码来源:dice-ware-test.ts

示例5: assertPoint

 dvb.findStop("Markt").then((data) => {
   assert.isNotEmpty(data);
   data.forEach((point) => {
     assertPoint(point);
     assert.strictEqual(point.type, dvb.POI_TYPE.Stop);
   });
 }));
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:7,代码来源:index.spec.ts

示例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);
     });
   }
 });
开发者ID:apollostack,项目名称:graphql-tools,代码行数:16,代码来源:testErrors.ts

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

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


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