Skip to content

Commit

Permalink
test(import_image): should not import non-image attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Jul 16, 2020
1 parent f74c4ca commit f3f3ab5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ describe('migrator', function() {
await unlink(path);
});

it('non-image', async () => {
const imageUrl = 'https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js';
const xml = wp(imageUrl, 'image.png');
const path = join(__dirname, 'image.xml');
await writeFile(path, xml);
await m({ _: [path], import_image: true });

const folderExist = await exists(join(hexo.source_dir));
folderExist.should.eql(false);

await unlink(path);
});
});

it('no argument', async () => {
Expand Down

0 comments on commit f3f3ab5

Please sign in to comment.