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


TypeScript assert.deepPropertyVal方法代码示例

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


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

示例1: readFile

        .run(err => {
          if (err) throw err;

          let pkg = JSON.parse(readFile(this.cwd, 'my-app/package.json'));
          assert.propertyVal(pkg, 'name', 'my-app');
          assert.propertyVal(pkg, 'version', '0.1.0');
          assert.propertyVal(pkg, 'description', 'My new app!');
          assert.propertyVal(pkg, 'license', 'MIT');
          assert.deepProperty(pkg, 'dependencies.neon-cli');

          let cargo = TOML.parse(readFile(this.cwd, 'my-app/native/Cargo.toml'));
          assert.deepPropertyVal(cargo, 'package.name', 'my-app');
          assert.deepPropertyVal(cargo, 'package.version', '0.1.0');
          assert.deepPropertyVal(cargo, 'package.license', 'MIT');
          assert.deepPropertyVal(cargo, 'lib.name', 'my_app');
          assert.deepProperty(cargo, 'dependencies.neon');

          let indexjs = readFile(this.cwd, 'my-app/lib/index.js');
          assert.include(indexjs, `require('../native')`);

          let librs = readFile(this.cwd, 'my-app/native/src/lib.rs');
          assert.include(librs, `extern crate neon;`);

          done();
        });
开发者ID:kodeballer,项目名称:neon,代码行数:25,代码来源:new.ts

示例2: it

  it("should update account name and revert it back", async () => {
    const { token } = store.state;
    const originalResp = await Account.getSingle({
      token,
      settings: { url: process.env.API_URL },
    });

    if (!originalResp.ok) {
      throw new Error(originalResp.error.title);
    }

    if (!originalResp.value.data) {
      throw new Error("data field is null");
    }

    const value = {
      name: {
        first: "Mike",
        last: "Wizowsky",
      },
    };

    const resp = await Account.update({
      token,
      value,

      query: {},
      settings: { url: process.env.API_URL },
    });

    if (!resp.ok) {
      throw new Error(resp.error.title);
    }

    assert.isTrue(resp.ok);
    assert.jsonSchema(resp.value.data, schema);
    assert.deepPropertyVal(resp.value.data, "name", {
      first: "Mike",
      last: "Wizowsky",
    });

    const revertUpdate = { name: originalResp.value.data.name };
    const revertResp = await Account.update({
      token,
      query: {},
      value: revertUpdate,
      settings: { url: process.env.API_URL },
    });

    if (!revertResp.ok) {
      throw new Error(revertResp.error.title);
    }

    assert.deepPropertyVal(revertResp.value.data, "name", revertUpdate.name);
  });
开发者ID:cycleplatform,项目名称:api-client-nodejs,代码行数:55,代码来源:updateAccount.test.ts

示例3: done

        .run(err => {
          if (err) throw err;

          let pkg = JSON.parse(readFile(this.cwd, 'my-app/package.json'));
          assert.propertyVal(pkg, 'description', 'Foo "bar"');
          assert.deepPropertyVal(pkg, 'repository.url', 'http://www.example.com/foo.git?bar=%22baz%22');
          assert.propertyVal(pkg, 'author', 'Foo "Bar" Baz <hughjass@example.com>');

          let cargo = TOML.parse(readFile(this.cwd, 'my-app/native/Cargo.toml'));
          assert.includeDeepMembers(cargo.package.authors, ['Foo "Bar" Baz <hughjass@example.com>'])

          done();
        });
开发者ID:kodeballer,项目名称:neon,代码行数:13,代码来源:new.ts

示例4: it

  it("should expand properties of types different from the root type", () => {
    const mapping = mhelper.createStructuredMapping("?post");
    const queryContext = new queryAdapter.QueryContext(mapping, nestedSchema.getEntityType("Human"),
      { Head: {} });
    const evaluator = new JsonResultBuilder(serviceUri);

    const idVar = mapping.getElementaryPropertyVariable("Id");
    const hIdVar = mapping.getComplexProperty("Head").getElementaryPropertyVariable("Id");
    const hEyeVar = mapping.getComplexProperty("Head").getElementaryPropertyVariable("EyeColor");

    const responses = [{}];
    const [response1] = responses;
    response1[idVar.substr(1)] = makeLiteral("1");
    response1[hIdVar.substr(1)] = makeLiteral("2");
    response1[hEyeVar.substr(1)] = makeLiteral("green");
    const results = evaluator.run(responses, queryContext);

    assert.deepPropertyVal(results[0], "Id", "1");
    assert.deepPropertyVal(results[0], "Head.Id", "2");
    assert.deepPropertyVal(results[0], "Head.EyeColor", "green");

  });
开发者ID:disco-network,项目名称:odata-rdf-interface,代码行数:22,代码来源:sparql_query_evaluation_spec.ts

示例5: it

 it('should set metadata to the node', () => {
     assert.deepPropertyVal(node, 'metadata', expectedMetadata);
 });
开发者ID:dssoft32,项目名称:javascript-obfuscator,代码行数:3,代码来源:NodeMetadata.spec.ts


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