mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-17 19:21:20 +03:00
feat(core): implement plugin api
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
const { iterate } = require('../lib/utils');
|
||||
|
||||
describe('@bbob/core utils', () => {
|
||||
test('iterate', () => {
|
||||
const testArr = [{
|
||||
one: true,
|
||||
content: [{ oneInside: true }]
|
||||
}, {
|
||||
two: true,
|
||||
content: [{ twoInside: true }]
|
||||
}];
|
||||
|
||||
const resultArr = iterate(testArr, node => {
|
||||
node.pass = 1;
|
||||
|
||||
return node;
|
||||
});
|
||||
|
||||
expect(resultArr).toEqual([{
|
||||
one: true,
|
||||
pass: 1,
|
||||
content: [{ oneInside: true, pass: 1, }]
|
||||
}, {
|
||||
two: true,
|
||||
pass: 1,
|
||||
content: [{ twoInside: true, pass: 1, }]
|
||||
}]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user