budibase/datastores/tests/helpers.js

9 lines
311 B
JavaScript
Raw Normal View History

2019-03-19 22:45:21 +01:00
import {map} from "lodash";
export const action = (name, run, iterator=iterateActionTimes(1)) => ({name, run, iterator});
export const iterateActionTimes = times => run =>
map([...Array(times).keys()], run);
export const iterateCollection = getCollection => run =>
map(getCollection(), run);