本文整理汇总了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();
});
示例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);
});
示例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();
});
示例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");
});
示例5: it
it('should set metadata to the node', () => {
assert.deepPropertyVal(node, 'metadata', expectedMetadata);
});