Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 9f1165e

Browse files
author
Louis Ye
committed
Fix lint issue
1 parent 1c1c76c commit 9f1165e

2 files changed

Lines changed: 46 additions & 28 deletions

File tree

src/agent/io/sourcemapper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ export class SourceMapper {
327327
* @param {Logger} logger A logger that reports errors that occurred while
328328
* processing the given sourcemap files
329329
*/
330-
export async function create(sourcemapPaths: string[], logger: Logger): Promise<SourceMapper> {
330+
export async function create(
331+
sourcemapPaths: string[],
332+
logger: Logger
333+
): Promise<SourceMapper> {
331334
const limit = pLimit(CONCURRENCY);
332335
const mapper = new SourceMapper(logger);
333336
const promises = sourcemapPaths.map(path =>

test/test-sourcemapper.ts

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,34 @@ function testTool(
5757
const logger = new MockLogger();
5858
let sourcemapper: sm.SourceMapper;
5959

60-
it('for tool ' + tool + ' sourcemapper should be created correctly',
61-
async () => {
62-
const start = Date.now();
63-
sourcemapper = await sm.create([mapFilePath], logger);
64-
assert(
65-
Date.now() - start < QUICK_MILLISECONDS,
66-
'should create the SourceMapper quickly');
60+
it(
61+
'for tool ' + tool + ' sourcemapper should be created correctly',
62+
async () => {
63+
const start = Date.now();
64+
sourcemapper = await sm.create([mapFilePath], logger);
65+
assert(
66+
Date.now() - start < QUICK_MILLISECONDS,
67+
'should create the SourceMapper quickly'
68+
);
6769

68-
// Verify if the debugging information is correctly printed.
69-
assert.notStrictEqual(
70-
logger.debugs[0].args[0].indexOf('debugging information ...'), -1);
71-
assert.notStrictEqual(logger.debugs[1].args[0].indexOf('source '), -1);
72-
assert.notStrictEqual(
73-
logger.debugs[2].args[0].indexOf('outputFile'), -1);
74-
assert.notStrictEqual(logger.debugs[3].args[0].indexOf('mapFile'), -1);
75-
assert.notStrictEqual(logger.debugs[4].args[0].indexOf('sources'), -1);
76-
assert.strictEqual(
77-
logger.debugs.length, sourcemapper.infoMap.size * 4 + 1);
78-
});
70+
// Verify if the debugging information is correctly printed.
71+
assert.notStrictEqual(
72+
logger.debugs[0].args[0].indexOf('debugging information ...'),
73+
-1
74+
);
75+
assert.notStrictEqual(logger.debugs[1].args[0].indexOf('source '), -1);
76+
assert.notStrictEqual(
77+
logger.debugs[2].args[0].indexOf('outputFile'),
78+
-1
79+
);
80+
assert.notStrictEqual(logger.debugs[3].args[0].indexOf('mapFile'), -1);
81+
assert.notStrictEqual(logger.debugs[4].args[0].indexOf('sources'), -1);
82+
assert.strictEqual(
83+
logger.debugs.length,
84+
sourcemapper.infoMap.size * 4 + 1
85+
);
86+
}
87+
);
7988

8089
it(
8190
'for tool ' +
@@ -143,17 +152,23 @@ function testTool(
143152
// Verify if the debugging information is correctly printed.
144153
const debugsLength = logger.debugs.length;
145154
assert.notStrictEqual(
146-
logger.debugs[debugsLength - 3].args[0].indexOf(
147-
'sourcemapper inputPath:'),
148-
-1);
155+
logger.debugs[debugsLength - 3].args[0].indexOf(
156+
'sourcemapper inputPath:'
157+
),
158+
-1
159+
);
149160
assert.notStrictEqual(
150-
logger.debugs[debugsLength - 2].args[0].indexOf(
151-
'sourcemapper sourcePos: {'),
152-
-1);
161+
logger.debugs[debugsLength - 2].args[0].indexOf(
162+
'sourcemapper sourcePos: {'
163+
),
164+
-1
165+
);
153166
assert.notStrictEqual(
154-
logger.debugs[debugsLength - 1].args[0].indexOf(
155-
'sourcemapper mappedPos: {'),
156-
-1);
167+
logger.debugs[debugsLength - 1].args[0].indexOf(
168+
'sourcemapper mappedPos: {'
169+
),
170+
-1
171+
);
157172

158173
assert.notStrictEqual(
159174
info,

0 commit comments

Comments
 (0)