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


TypeScript assert.isDefined方法代码示例

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


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

示例1: it

    it('Produces new session when query changes', async () => {

        assert.isUndefined(routingStore._session);

        routingStore.urlLengthThresholdForSession = 4;

        routingStore.updateRoute({
            param1: undefined,
            param2: 'altered',
            param3: 'new'
        });

        assert.isDefined(routingStore._session);
        assert.isDefined(routingStore.location.query.session_id);

        await sleep(0);

        assert.equal(routingStore.location.query.session_id, 'somekey','we have non-pending session_id');

        saveRemoteSessionStub.returns(Promise.resolve({id:'monkeys'}));

        // now change route again
        routingStore.updateRoute({
            param1: undefined,
            param2: 'blah',
            param3: 'another'
        });

        assert.equal(routingStore.location.query.session_id, 'pending', 'goes to pending');

        await sleep(0);

        assert.equal(routingStore.location.query.session_id, 'monkeys','we have a new session id');

    });
开发者ID:agarwalrounak,项目名称:cbioportal-frontend,代码行数:35,代码来源:ExtendedRouterStore.spec.ts

示例2: test

  test('resolves the Polymer.Base class', async () => {
    // This directory contains files copied from Polymer 1.x core.
    const analyzer = Analyzer.createForDirectory(
        path.resolve(fixtureDir, 'polymer-core-feature/'));

    const analysis = await analyzer.analyzePackage();
    const features = analysis.getFeatures({id: 'Polymer.Base', kind: 'class'});
    assert.equal(features.size, 1);
    const polymerBase = features.values().next().value;
    assert.equal(polymerBase.methods.size, 35);
    assert.equal(polymerBase.properties.size, 2);

    // A method from debounce.html
    const debounce = polymerBase.methods.get('debounce');
    assert.isDefined(debounce);
    assert.equal(debounce!.privacy, 'public');
    assert.equal(debounce!.params![0].name, 'jobName');

    // A method from base.html
    const addFeature = polymerBase.methods.get('_addFeature');
    assert.isDefined(addFeature);
    assert.equal(addFeature!.privacy, 'protected');

    // A property from behaviors.html
    const behaviors = polymerBase.properties.get('behaviors');
    assert.isDefined(behaviors);
  });
开发者ID:asdfg9822,项目名称:polymer-analyzer,代码行数:27,代码来源:polymer-core-feature_test.ts

示例3: it

 it("should correctly dispatch receiveMetrics", function() {
   let response = new protos.cockroach.ts.TimeSeriesQueryResponse({
     results: [
       {
         datapoints: [],
       },
     ],
   });
   let request = new protos.cockroach.ts.TimeSeriesQueryRequest({
     start_nanos: Long.fromInt(0),
     end_nanos: Long.fromInt(10),
     queries: [
       {
         name: "test.metric.1",
       },
     ],
   });
   state = reducer(state, metrics.receiveMetrics(componentID, request, response));
   assert.isDefined(state.queries);
   assert.isDefined(state.queries[componentID]);
   assert.lengthOf(_.keys(state.queries), 1);
   assert.equal(state.queries[componentID].data, response);
   assert.equal(state.queries[componentID].request, request);
   assert.isUndefined(state.queries[componentID].nextRequest);
   assert.isUndefined(state.queries[componentID].error);
 });
开发者ID:WillHaack,项目名称:cockroach,代码行数:26,代码来源:metrics.spec.ts

示例4: it

    it('basic', function () {
      assert.isDefined(Store);
      assert.isFunction(Store);

      var instance = new Store();
      assert.isDefined(instance);
      assert.isObject(instance);
      assert.isDefined(instance._type);
      assert.isString(instance._type);
      assert.equal(instance._type, 'Relution.livedata.Store');
    })
开发者ID:relution-io,项目名称:relution-sdk,代码行数:11,代码来源:Store.spec.ts

示例5: it

    it('basic', function () {
      assert.isDefined(Collection);
      assert.isFunction(Collection);

      var instance = new Collection();
      assert.isDefined(instance);
      assert.isObject(instance);
      assert.isDefined(instance._type);
      assert.isString(instance._type);
      assert.equal(instance._type, 'Relution.livedata.Collection');
    }),
开发者ID:relution-io,项目名称:relution-sdk,代码行数:11,代码来源:Collection.spec.ts

示例6: it

 it("default", () => {
     const resolver = new CommandLine({ options: { } });
     assert.isUndefined(resolver.getDefaultGroup());
     assert.isUndefined(resolver.getPassthruOption());
     assert.isUndefined(resolver.getRestOption());
     assert.isDefined(resolver.getHelpOption());
     assert.deepEqual(resolver.groups, []);
     assert.isDefined(resolver.fromShortName("?"));
     assert.isDefined(resolver.fromShortName("h"));
     assert.isDefined(resolver.fromLongName("help"));
 });
开发者ID:rbuckton,项目名称:power-options,代码行数:11,代码来源:resolver.ts

示例7: it

    it('basic', function () {
      assert.isDefined(Model);
      assert.isFunction(Model);

      var instance = new Model();
      assert.isDefined(instance);
      assert.isObject(instance);
      assert.isDefined(instance._type);
      assert.isString(instance._type);
      assert.equal(instance._type, 'Relution.livedata.Model');
    }),
开发者ID:relution-io,项目名称:relution-sdk,代码行数:11,代码来源:Model.spec.ts

示例8: it

        it("should find elements", async () => {
            firstButton = await driver.findElementByAutomationText("Toggle first");
            secondButton = await driver.findElementByAutomationText("Toggle second");

            firstLabel = await driver.findElementByAutomationText("== 1 ==");
            secondLabel = await driver.findElementByAutomationText("== 2 ==");

            assert.isDefined(firstButton);
            assert.isDefined(secondButton);
            assert.isDefined(firstLabel);
            assert.isDefined(secondLabel);
        });
开发者ID:NathanWalker,项目名称:nativescript-angular,代码行数:12,代码来源:ngif.e2e-spec.ts


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