From 7ce64a99ff7e48fd476fa069cf47141bfa6273a9 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Wed, 11 Nov 2020 16:35:35 +0100 Subject: [PATCH] Add test case for #286 --- test/index.js | 21 +++++++++++++++++++++ testdata/import/index.html | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 testdata/import/index.html diff --git a/test/index.js b/test/index.js index 14dc936..130e0fe 100644 --- a/test/index.js +++ b/test/index.js @@ -517,6 +517,27 @@ describe('hyperlink', function () { }); }); }); + + it('should handle a JavaScript import', async function () { + const t = new TapRender(); + sinon.spy(t, 'push'); + await hyperlink( + { + recursive: false, + root: pathModule.resolve(__dirname, '..', 'testdata', 'import'), + inputUrls: ['index.html'], + }, + t + ); + + expect(t.close(), 'to satisfy', { + count: 4, + pass: 4, + fail: 0, + skip: 0, + todo: 0, + }); + }); }); describe('with document fragments', function () { diff --git a/testdata/import/index.html b/testdata/import/index.html new file mode 100644 index 0000000..c715fc0 --- /dev/null +++ b/testdata/import/index.html @@ -0,0 +1,4 @@ +