Skip to content

Commit cb1b839

Browse files
reduce complexity
1 parent 5bfc095 commit cb1b839

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

recipes/correct-ts-specifiers/src/map-imports.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ describe('Map Imports', { concurrency: true }, () => {
1717
before(async () => {
1818
const error = mock.fn<LoggerFunction>();
1919
const warn = mock.fn<LoggerFunction>();
20-
const info = mock.fn<LoggerFunction>();
21-
const debug = mock.fn<LoggerFunction>();
2220

2321
mock__error = error;
2422
mock__warn = warn;
2523

2624
mock.module('@nodejs/codemod-utils/logger', {
27-
defaultExport: { error, warn, info, debug },
25+
defaultExport: { error, warn },
2826
});
2927

3028
({ mapImports } = await import('./map-imports.ts'));
@@ -67,9 +65,9 @@ describe('Map Imports', { concurrency: true }, () => {
6765

6866
const { 0: message } = mock__error.mock.calls[0].arguments;
6967

70-
assert.match(message as string, new RegExp(originatingFilePath));
71-
assert.match(message as string, /no match/i);
72-
assert.match(message as string, new RegExp(specifier));
68+
assert.match(message, new RegExp(originatingFilePath));
69+
assert.match(message, /no match/i);
70+
assert.match(message, new RegExp(specifier));
7371
});
7472

7573
it('unambiguous: should not change the file extension when JS file DOES exist & TS file does NOT exist', async () => {

recipes/correct-ts-specifiers/src/replace-js-ext-with-ts-ext.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ describe('Correcting ts file extensions', { concurrency: true }, () => {
2222

2323
before(async () => {
2424
const error = mock.fn<LoggerFunction>();
25-
const warn = mock.fn<LoggerFunction>();
26-
const info = mock.fn<LoggerFunction>();
27-
const debug = mock.fn<LoggerFunction>();
2825

2926
mock__error = error;
3027
mock__logger = mock.module('@nodejs/codemod-utils/logger', {
31-
defaultExport: { error, warn, info, debug },
28+
defaultExport: { error },
3229
});
3330

3431
({ replaceJSExtWithTSExt } = await import('./replace-js-ext-with-ts-ext.ts'));

0 commit comments

Comments
 (0)