本文整理汇总了TypeScript中ramda/src/pluck.pluck函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pluck函数的具体用法?TypeScript pluck怎么用?TypeScript pluck使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pluck函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('GET will return all available tribes.', async function () {
const tribes = [
{id: 'Uno', name: 'one'},
{id: 'Dos', name: 'two'},
{id: 'Tres', name: 'three'}
];
await tribesCollection.insert(tribes);
let authorizedTribes = pluck('id', tribes);
await authorizeUserForTribes(authorizedTribes);
const response = await host.get(path)
.expect(200)
.expect('Content-Type', /json/);
expect(pluck('id', response.body))
.toEqual(pluck('id', tribes));
expect(pluck('names', response.body))
.toEqual(pluck('names', tribes));
});
示例2: pluck
.then(function (tribeDocuments) {
const authorizedTribes = pluck('id', tribeDocuments);
return e2eHelp.authorizeUserForTribes(authorizedTribes);
});
示例3: it
it('should have a section for each tribe', function () {
const tribeElements = tribeListPage.getTribeElements();
expect(tribeElements.getText()).toEqual(pluck('name', tribeDocuments));
});
示例4: pipe
.then(function (documents) {
return pipe(
pluck('tribe'),
union(user.tribes)
)(documents);
});
示例5: it
it('will show all the players ', function () {
const playerElements = element.all(By.repeater('selectable in prepare.selectablePlayers'));
expect(playerElements.getText()).toEqual(pluck('name', players));
});
示例6: it
it('will show all players', function () {
browser.setLocation(`/${tribe.id}/player/new`);
const playerElements = element.all(By.repeater('player in players'));
expect(playerElements.getText()).toEqual(pluck('name', players));
});