Skip to content

Commit 62f0cc2

Browse files
authored
Merge pull request #150 from curbengh/destructure
refactor: destructure
2 parents fa1f04a + 6a037f5 commit 62f0cc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ describe('Feed generator', () => {
256256
const result = generator(locals, feedCfg.type, feedCfg.path);
257257

258258
const { items } = await p(result.data);
259-
const postImg = items.filter(({ image }) => image.length)[0];
259+
const [postImg] = items.filter(({ image }) => image.length);
260260
postImg.image.length.should.not.eql(0);
261261
};
262262

@@ -280,7 +280,7 @@ describe('Feed generator', () => {
280280
const feedCfg = hexo.config.feed;
281281
const result = generator(locals, feedCfg.type, feedCfg.path);
282282
const { items } = await p(result.data);
283-
const postImg = items.filter(({ image }) => image.length)[0];
283+
const [postImg] = items.filter(({ image }) => image.length);
284284

285285
postImg.image.should.eql(full_url_for.call(hexo, 'test.png'));
286286
});

0 commit comments

Comments
 (0)