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


TypeScript assert.isNumber方法代码示例

本文整理汇总了TypeScript中chai.assert.isNumber方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isNumber方法的具体用法?TypeScript assert.isNumber怎么用?TypeScript assert.isNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chai.assert的用法示例。


在下文中一共展示了assert.isNumber方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: assertTransport

export function assertTransport(transport: IMonitor) {
  assertNotEmptyString(transport.id);
  assertNotEmptyString(transport.line);
  assertNotEmptyString(transport.direction);

  assert.isNumber(transport.arrivalTimeRelative);
  assert.isNumber(transport.scheduledTimeRelative);
  assert.isNumber(transport.delayTime);

  assert.instanceOf(transport.arrivalTime, Date);
  assert.instanceOf(transport.scheduledTime, Date);

  assert.property(transport, "state");

  assertMode(transport.mode);

  if (transport.line && transport.line.indexOf("E") === -1) {
    assertDiva(transport.diva!);
  } else {
    assert.isUndefined(transport.diva);
  }

  assert.isDefined(transport.platform);
  assertPlatform(transport.platform!);
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:25,代码来源:helper.ts

示例2: assertTrip

export function assertTrip(trip: ITrip) {
  assertStopLocation(trip.departure!);
  assertStopLocation(trip.arrival!);
  assert.isNumber(trip.duration);
  assert.isNumber(trip.interchanges);

  assert.isArray(trip.nodes);
  trip.nodes.forEach(assertNode);
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:9,代码来源:helper.ts

示例3: assert

			const checkSubCall = (call: sinon.SinonSpyCall, methodData: string) => {
				const callArgs = call.args;
				const methodInfo = callArgs[0];
				const startTime = callArgs[1];
				const endTime = callArgs[2];

				assert(methodInfo === methodData);
				assert.isNumber(startTime);
				assert.isNumber(endTime);
				assert.isTrue(endTime > startTime);
				assert.isDefined(callArgs[3][0] === "test");
			};
开发者ID:NativeScript,项目名称:nativescript-cli,代码行数:12,代码来源:decorators.ts

示例4: assertDiva

export function assertDiva(diva: IDiva) {
  assert.isObject(diva);

  assert.property(diva, "number");
  assert.isNumber(diva.number);

  assert.property(diva, "network");
  assertNotEmptyString(diva.network);
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:9,代码来源:helper.ts

示例5: it

    it("Github test", async () => {
        await client.url("https://github.com/");
        await client.waitForVisible('.header-logo-invertocat');

        const elementSize = await client.getElementSize(".header-logo-invertocat");

        assert.isNumber(elementSize.height);
        assert.isNumber(elementSize.width);
        assert.strictEqual(elementSize.height, 32);
        assert.strictEqual(elementSize.width, 32);

        const title = await client.getTitle();
        assert.isString(title);
        assert.strictEqual(title, "The world's leading software development platform ¡ GitHub");

        const cssProperty = await client.getCssProperty("a[href='/pricing']", "color");
        assert.strictEqual(cssProperty.value, "rgba(255,255,255,1)");
    });
开发者ID:VincentDamour,项目名称:DefinitelyTyped,代码行数:18,代码来源:webdriverio-tests.ts

示例6: it

    it("Github test",function() {
        client.url("https://github.com/");

        var elementSize = client.getElementSize(".header-logo-wordmark");

        var foo = client.getElementSize('div');

        assert.isNumber(elementSize.height);
        assert.isNumber(elementSize.width);
        assert.strictEqual(elementSize.height, 26);
        assert.strictEqual(elementSize.width, 89);

        var title = client.getTitle();
        assert.isString(title);
        assert.strictEqual(title, "GitHub ¡ Where software is built");

        var cssProperty = client.getCssProperty("a[href='/plans']", "color");
        assert.strictEqual(cssProperty.value, "rgba(64,120,192,1)");
    });
开发者ID:ArtemZag,项目名称:DefinitelyTyped,代码行数:19,代码来源:webdriverio-tests.ts

示例7:

                ).then((data) => {
                    let tokenData = JSON.parse(data.body);
                    assert.isOk(tokenData.access_token);
                    assert.isOk(tokenData.token_type);
                    assert.isNumber(tokenData.expires_in);
                    assert.isOk(tokenData.refresh_token);

                    return appInstance.getContainer().getAccessTokenDataMapper().getById(tokenData.access_token).then((token) => {
                        assert.equal(token.clientId, client.id);
                        assert.equal(token.id, tokenData.access_token);
                        assert.equal(token.type, tokenData.token_type);
                        assert.equal(token.userId, fixtureData.user.username);

                        // @todo add more specific tests that count time
                        assert.isTrue(moment(token.expiresAt).isAfter(moment()));
                    })
                });
开发者ID:kamilbiela,项目名称:auth360-backend,代码行数:17,代码来源:authorization.spec.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.isNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。