本文整理汇总了TypeScript中benchpress/common.provide函数的典型用法代码示例。如果您正苦于以下问题:TypeScript provide函数的具体用法?TypeScript provide怎么用?TypeScript provide使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了provide函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: createReporter
function createReporter({sampleId, descriptions, metrics, path}) {
var bindings = [
JsonFileReporter.BINDINGS,
provide(
SampleDescription, {useValue: new SampleDescription(sampleId, descriptions, metrics)}),
bind(JsonFileReporter.PATH).toValue(path),
bind(Options.NOW).toValue(() => DateWrapper.fromMillis(1234)),
bind(Options.WRITE_FILE).toValue((filename, content) => {
loggedFile = {'filename': filename, 'content': content};
return PromiseWrapper.resolve(null);
})
];
return Injector.resolveAndCreate(bindings).get(JsonFileReporter);
}
开发者ID:LordBinary,项目名称:angular,代码行数:14,代码来源:json_file_reporter_spec.ts
示例2: createExtension
function createExtension(perfRecords = null): WebDriverExtension {
if (isBlank(perfRecords)) {
perfRecords = [];
}
log = [];
extension =
Injector
.resolveAndCreate([
IOsDriverExtension.BINDINGS,
provide(WebDriverAdapter, {useValue: new MockDriverAdapter(log, perfRecords)})
])
.get(IOsDriverExtension);
return extension;
}
开发者ID:LordBinary,项目名称:angular,代码行数:14,代码来源:ios_driver_extension_spec.ts
示例3: createReporter
function createReporter({columnWidth = null, sampleId = null, descriptions = null,
metrics = null}: {columnWidth?, sampleId?, descriptions?, metrics?}) {
log = [];
if (isBlank(descriptions)) {
descriptions = [];
}
if (isBlank(sampleId)) {
sampleId = 'null';
}
var bindings = [
ConsoleReporter.BINDINGS,
provide(SampleDescription,
{useValue: new SampleDescription(sampleId, descriptions, metrics)}),
bind(ConsoleReporter.PRINT).toValue((line) => log.push(line))
];
if (isPresent(columnWidth)) {
bindings.push(bind(ConsoleReporter.COLUMN_WIDTH).toValue(columnWidth));
}
reporter = ReflectiveInjector.resolveAndCreate(bindings).get(ConsoleReporter);
}
开发者ID:844496869,项目名称:angular,代码行数:20,代码来源:console_reporter_spec.ts
示例4: provide
ids.map(id => provide(id, {useValue: new MockExtension(id)})),
开发者ID:844496869,项目名称:angular,代码行数:1,代码来源:web_driver_extension_spec.ts
示例5: provide
ids.map(id => provide(id, {useValue: new MockMetric(id)})),
开发者ID:0xJoKe,项目名称:angular,代码行数:1,代码来源:multi_metric_spec.ts
示例6: provide
ids.map(id => provide(id, {useValue: new MockReporter(id)})),
开发者ID:ProjectFrank,项目名称:angular,代码行数:1,代码来源:multi_reporter_spec.ts
注:本文中的benchpress/common.provide函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论