Skip to content

Commit b9c818e

Browse files
committed
chore: add loggers
1 parent bef0365 commit b9c818e

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

__tests__/page-loader.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'debug';
2+
import 'axios-debug-log';
13
import os from 'os';
24
import fs from 'fs/promises';
35
import path from 'path';

package-lock.json

+28-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"description": "[![Actions Status](https://github.com/nowaylifer/frontend-testing-react-project-67/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/nowaylifer/frontend-testing-react-project-67/actions)",
66
"main": "index.js",
77
"scripts": {
8-
"test": "jest --runInBand"
8+
"test": "jest --runInBand",
9+
"test:log-nock": "DEBUG=nock.* jest --runInBand",
10+
"test:log-axios": "DEBUG=axios jest --runInBand"
911
},
1012
"bin": {
1113
"page-loader": "npx babel-node cli"
@@ -26,8 +28,10 @@
2628
},
2729
"dependencies": {
2830
"axios": "^1.5.1",
31+
"axios-debug-log": "^1.0.0",
2932
"cheerio": "^1.0.0-rc.12",
3033
"commander": "^11.0.0",
34+
"debug": "^4.3.4",
3135
"fs-cheerio": "^3.0.0"
3236
}
3337
}

page-loader.js

-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class PageLoader {
2525

2626
await this.#createResourceDir();
2727
await this.#loadResources();
28-
// await this.#loadImages();
2928

3029
await fsc.writeFile(filepath, $);
3130

@@ -63,11 +62,6 @@ export class PageLoader {
6362
await Promise.allSettled(promises);
6463
}
6564

66-
// async #loadImages() {
67-
// const $images = $('img');
68-
// await Promise.allSettled($images.map((_, img) => this.#loadResource(img)));
69-
// }
70-
7165
#getUrlAttr(element) {
7266
return element.name === 'link' ? 'href' : 'src';
7367
}

0 commit comments

Comments
 (0)