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


TypeScript assert.isNotNull方法代码示例

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


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

示例1: it

    it("should verify BuildService.GetBuildDefinitions", async function() {
        this.timeout(TestSettings.TestTimeout); //http://mochajs.org/#timeouts

        const ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl);
        ctx.CredentialHandler = CredentialManager.GetCredentialHandler();
        ctx.RepoInfo = Mocks.RepositoryInfo();
        ctx.UserInfo = undefined;

        const svc: BuildService = new BuildService(ctx);
        const definitions = await svc.GetBuildDefinitions(TestSettings.TeamProject);
        assert.isNotNull(definitions, "definitions was null when it shouldn't have been");
        //console.log(definitions.length);
        expect(definitions.length).to.be.at.least(1);
    });
开发者ID:creativewebmatrixsolutions,项目名称:vsts-vscode,代码行数:14,代码来源:build.integration.test.ts

示例2: it

    it("should verify WorkItemTrackingService.CreateWorkItem", async function() {
        this.timeout(TestSettings.TestTimeout); //http://mochajs.org/#timeouts

        const ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl);
        ctx.CredentialHandler = CredentialManager.GetCredentialHandler();
        ctx.RepoInfo = Mocks.RepositoryInfo();
        ctx.UserInfo = undefined;

        const itemType : string = "Bug";
        const today: Date = new Date();
        const title: string = "Work item created by integration test (" + today.toLocaleString() + ")";
        const svc: WorkItemTrackingService = new WorkItemTrackingService(ctx);
        const item: WorkItem = await svc.CreateWorkItem(ctx, itemType, title);
        assert.isNotNull(item, "item was null when it shouldn't have been");
    });
开发者ID:Microsoft,项目名称:vsts-vscode,代码行数:15,代码来源:workitemtracking.integration.test.ts

示例3: it

 it('works with Map<X,Object>', () => {
     let map = new Map<string, Thing>();
     map.set('1', new Thing(1, '1'));
     let storePath = path.join(process.cwd(), 'x.db');
     encoder.serializeToFileSync(storePath, map);
     let other = encoder.deserializeFromFileSync(storePath);
     let found: Thing = null;
     for (let thing of map.values()) {
         if (thing.xname == '1') {
             found = thing;
             break;;
         }
     }
     let type = typeof found;
     assert.isTrue('object' == type)
     assert.isNotNull(found);
     //WRONG they are both MAPs not Objects 
     assert.deepEqual(map, other);
 })
开发者ID:D10221,项目名称:map-encoder,代码行数:19,代码来源:encoder_test.ts

示例4: it

        it("gives the correct regression equation, R^2, and function for a sample input with strong correlation", ()=>{
            const data:[number,number][] = [
                [0,0.33517481],
                [1,3.00712561],
                [2,6.73118302],
                [3,9.25128682],
                [4,12.0432596],
                [5,15.9087018],
                [6,18.71122156],
                [7,21.69213527],
                [8,24.57708193],
                [9,27.98002031],
                [10,30.67017471],
                [11,33.55231386],
                [12,36.20724938],
                [13,39.21414698],
                [14,42.74163248],
                [15,45.95986539],
                [16,48.28399276],
                [17,51.52361803],
                [18,54.62495359]
            ];

            const computations = getRegressionComputations(data);
            // target values computed via python: scipy.stats.linregress
            const m = 3.0120636256561446;
            const b = 0.41853989070105158;
            const r2 = 0.99970735279778178;
            // test regression equation to make sure its approximately the same as what python gives
            const match = computations.string.match(/y = ([\d.]+)x \+ ([\d.]+)/);
            assert.isNotNull(match, "equation has correct form");
            const M = parseFloat(match![1]);
            const B = parseFloat(match![2]);
            assert.approximately(M, m, 0.05);
            assert.approximately(B, b, 0.05);
            // make sure `predict` gives the same result as the equation
            for (let i=0; i<100; i+=1) {
                assert.approximately(computations.predict(i)[1], M*i + B, 0.0000005, `value for ${i}`);
            }
            // test R^2
            assert.approximately(computations.r2,  r2, 0.05, "R^2");
        });
开发者ID:agarwalrounak,项目名称:cbioportal-frontend,代码行数:42,代码来源:ScatterPlotUtils.spec.ts

示例5: it

	it('should return appropriate step constraint', () => {
		const api = createApi();
		const obj = {foo: 1};
		const bapi = api.addInput(obj, 'foo', {
			step: 1,
		});

		const iv = bapi.controller.controller.value;
		assert.instanceOf(iv, InputValue);

		if (!(iv instanceof InputValue)) {
			throw new Error('Input value is empty');
		}
		const c: Constraint<unknown> | null = TypeUtil.forceCast(iv.constraint);
		if (!c) {
			throw new Error('Constraint is empty');
		}

		assert.isNotNull(ConstraintUtil.findConstraint(c, StepConstraint));
	});
开发者ID:cocopon,项目名称:tweakpane,代码行数:20,代码来源:root-number-input-test.ts

示例6: it

    it('should return error for invalid specs', function() {
      assert.isNotNull(getEncodingMappingError({
        mark: LINE,
        encoding: {
          x: {field: 'b'} // missing y
        }
      }));

      assert.isNotNull(getEncodingMappingError({
        mark: AREA,
        encoding: {
          y: {field: 'b'} // missing x
        }
      }));

      assert.isNotNull(getEncodingMappingError({
        mark: TEXT,
        encoding: {
          y: {field: 'b'} // missing text
        }
      }));

      assert.isNotNull(getEncodingMappingError({
        mark: LINE,
        encoding: {
          shape: {field: 'b'} // using shape with line
        }
      }));

      assert.isNotNull(getEncodingMappingError({
        mark: AREA,
        encoding: {
          shape: {field: 'b'} // using shape with area
        }
      }));

      assert.isNotNull(getEncodingMappingError({
        mark: BAR,
        encoding: {
          shape: {field: 'b'} // using shape with bar
        }
      }));
    });
开发者ID:Afelio,项目名称:vega-lite,代码行数:43,代码来源:validate.test.ts

示例7: done

 todo.save<AV.Object>().then((todo)=>{
   // 保存成功,可以打开控制台核对修改结果
   chai.assert.isNotNull(todo.get('title'));
   done();
 },(error)=>{
开发者ID:wujun4code,项目名称:typed-leancloud-jssdk,代码行数:5,代码来源:object.ts

示例8: execCli

 execCli(["-c", "./test/config/tslint-custom-rules.json", "-r", "./someRandomDir", "src/test.ts"], (err) => {
     assert.isNotNull(err, "process should exit with error");
     assert.strictEqual(err.code, 1, "error code should be 1");
     done();
 });
开发者ID:IllusionMH,项目名称:tslint,代码行数:5,代码来源:executableTests.ts

示例9:

 .then((work: Work) => {
   assert.isNotNull(work.result);
   assert.equal(work.result.result, 3);
   assert.lengthOf(work.childrenIDs, 1);
   assert.lengthOf(work.finishedChildrenIDs, 1);
 });
开发者ID:colinmathews,项目名称:node-workhorse-aws,代码行数:6,代码来源:dynamodb-spec.ts


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