diff --git a/test/downloader/worker-pool.spec.ts b/test/downloader/worker-pool.spec.ts index 9620c7bc..068e113e 100644 --- a/test/downloader/worker-pool.spec.ts +++ b/test/downloader/worker-pool.spec.ts @@ -1,7 +1,7 @@ import {join} from 'path'; // noinspection ES6PreferShortImport -import type {WorkerInfo} from '../../src/downloader/worker-pool'; -import {WorkerPool} from '../../src/downloader/worker-pool'; +import type {WorkerInfo} from '../../src/downloader/worker-pool.js'; +import {WorkerPool} from '../../src/downloader/worker-pool.js'; describe('worker-pool', function () { test('pool would work correctly', async () => { diff --git a/test/life-cycle/detect-resource-type.spec.ts b/test/life-cycle/detect-resource-type.spec.ts index 9841ea8c..fb0c28fd 100644 --- a/test/life-cycle/detect-resource-type.spec.ts +++ b/test/life-cycle/detect-resource-type.spec.ts @@ -2,8 +2,8 @@ import { binaryExtension, detectResourceType -} from '../../src/life-cycle/detect-resource-type'; -import {ResourceType} from '../../src/resource'; +} from '../../src/life-cycle/detect-resource-type.js'; +import {ResourceType} from '../../src/resource.js'; describe('detect-resource-type', function () { diff --git a/test/life-cycle/process-source-map.spec.ts b/test/life-cycle/process-source-map.spec.ts index a69953b0..42dc5867 100644 --- a/test/life-cycle/process-source-map.spec.ts +++ b/test/life-cycle/process-source-map.spec.ts @@ -1,17 +1,17 @@ -import type {CreateResourceArgument, Resource} from '../../src/resource'; -import {createResource, ResourceType} from '../../src/resource'; +import type {CreateResourceArgument, Resource} from '../../src/resource.js'; +import {createResource, ResourceType} from '../../src/resource.js'; import { isUriChar, processSourceMap, SOURCE_MAP_HEADER, sourceMapPrefix, X_SOURCE_MAP_HEADER -} from '../../src/life-cycle/process-source-map'; -import type {DownloadResource} from '../../src/life-cycle/types'; +} from '../../src/life-cycle/process-source-map.js'; +import type {DownloadResource} from '../../src/life-cycle/types.js'; // noinspection ES6PreferShortImport -import type {PipelineExecutor} from '../../src/life-cycle/pipeline-executor'; -import type {StaticDownloadOptions} from '../../src/options'; -import type {Cheerio} from '../../src/types'; +import type {PipelineExecutor} from '../../src/life-cycle/pipeline-executor.js'; +import type {StaticDownloadOptions} from '../../src/options.js'; +import type {Cheerio} from '../../src/types.js'; const fakeRes = (url: string): DownloadResource => { const arg: CreateResourceArgument = { diff --git a/test/life-cycle/save-html-to-disk.spec.ts b/test/life-cycle/save-html-to-disk.spec.ts index 2d2591fd..4d5c7994 100644 --- a/test/life-cycle/save-html-to-disk.spec.ts +++ b/test/life-cycle/save-html-to-disk.spec.ts @@ -1,16 +1,16 @@ import {load} from 'cheerio'; import * as fs from 'fs'; // noinspection ES6PreferShortImport -import {saveHtmlToDisk} from '../../src/life-cycle/save-html-to-disk'; +import {saveHtmlToDisk} from '../../src/life-cycle/save-html-to-disk.js'; import { fakeOpt, fakePipeline, mockFs, mockModules, resHtml as res -} from './save-mock-fs'; +} from './save-mock-fs.js'; import {join} from 'path'; -import {ResourceType} from '../../src/resource'; +import {ResourceType} from '../../src/resource.js'; mockModules(); diff --git a/test/life-cycle/save-mock-fs.ts b/test/life-cycle/save-mock-fs.ts index d64e10b3..73e1bf13 100644 --- a/test/life-cycle/save-mock-fs.ts +++ b/test/life-cycle/save-mock-fs.ts @@ -3,14 +3,14 @@ import type { Resource, ResourceBody, ResourceEncoding -} from '../../src/resource'; -import {createResource, ResourceType} from '../../src/resource'; -import type {DownloadResource} from '../../src/life-cycle/types'; -import type {StaticDownloadOptions} from '../../src/options'; +} from '../../src/resource.js'; +import {createResource, ResourceType} from '../../src/resource.js'; +import type {DownloadResource} from '../../src/life-cycle/types.js'; +import type {StaticDownloadOptions} from '../../src/options.js'; // noinspection ES6PreferShortImport -import type {PipelineExecutor} from '../../src/life-cycle/pipeline-executor'; +import type {PipelineExecutor} from '../../src/life-cycle/pipeline-executor.js'; import {promises} from 'fs'; -import {toString} from '../../src/util'; +import {toString} from '../../src/util.js'; export const fakeOpt = { concurrency: 0, diff --git a/test/life-cycle/save-resource-to-disk.spec.ts b/test/life-cycle/save-resource-to-disk.spec.ts index b910cd49..7cc8f287 100644 --- a/test/life-cycle/save-resource-to-disk.spec.ts +++ b/test/life-cycle/save-resource-to-disk.spec.ts @@ -1,8 +1,16 @@ import * as fs from 'fs'; // noinspection ES6PreferShortImport -import {saveResourceToDisk} from '../../src/life-cycle/save-resource-to-disk'; +import { + saveResourceToDisk +} from '../../src/life-cycle/save-resource-to-disk.js'; import {join} from 'path'; -import {fakeOpt, fakePipeline, mockFs, mockModules, res} from './save-mock-fs'; +import { + fakeOpt, + fakePipeline, + mockFs, + mockModules, + res +} from './save-mock-fs.js'; mockModules(); diff --git a/test/life-cycle/skip-links.spec.ts b/test/life-cycle/skip-links.spec.ts index 8259be94..25d9e9a3 100644 --- a/test/life-cycle/skip-links.spec.ts +++ b/test/life-cycle/skip-links.spec.ts @@ -1,7 +1,7 @@ import { skipLinks, unProcessableUriSchemes -} from '../../src/life-cycle/skip-links'; +} from '../../src/life-cycle/skip-links.js'; describe('life-cycle/skip-links', function () { test('skip-un-processable-uri-schemes', () => { diff --git a/test/resource.spec.ts b/test/resource.spec.ts index 5fe9d38d..bbc032e7 100644 --- a/test/resource.spec.ts +++ b/test/resource.spec.ts @@ -3,7 +3,7 @@ import type { CreateResourceArgument, RawResource, Resource -} from '../src/resource'; +} from '../src/resource.js'; import { checkAbsoluteUri, createResource, @@ -13,8 +13,8 @@ import { resolveFileUrl, ResourceType, urlOfSavePath -} from '../src/resource'; -import URI = require('urijs'); +} from '../src/resource.js'; +import URI from 'urijs'; describe('resource', function () { test('html-to-html-resource', () => { diff --git a/test/sources.spec.ts b/test/sources.spec.ts index d387e41b..b73d31d2 100644 --- a/test/sources.spec.ts +++ b/test/sources.spec.ts @@ -1,6 +1,6 @@ -import {sources} from '../src/sources'; +import {sources} from '../src/sources.js'; import {load} from 'cheerio'; -import {ResourceType} from '../src/resource'; +import {ResourceType} from '../src/resource.js'; describe('sources', function () { test('source should contains type', () => { diff --git a/test/util.spec.ts b/test/util.spec.ts index e23a7a3f..35e6a89d 100644 --- a/test/util.spec.ts +++ b/test/util.spec.ts @@ -2,10 +2,12 @@ import { arrayToMap, escapePath, importDefaultFromPath, - isSiteMap, isUrlHttp, + isSiteMap, + isUrlHttp, sleep, - toString, weakAssign -} from '../src/util'; + toString, + weakAssign +} from '../src/util.js'; import {join} from 'path'; describe('util', function () {