Skip to content

Commit 2af9a96

Browse files
committed
add alias to simplify imports
1 parent e4a30e7 commit 2af9a96

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ module.exports = {
8989
// Jest does not support WASM imports from ESM modules
9090
// https://github.com/facebook/jest/issues/9430
9191
'^@iohk-jormungandr/wallet-js$': 'identity-obj-proxy',
92+
'tests/(.*)': '<rootDir>/tests/$1',
9293
},
9394

9495
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader

source/renderer/app/components/assets/AssetSettingsDialog.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import React from 'react';
44
import noop from 'lodash/noop';
55
import { cleanup, screen, waitFor } from '@testing-library/react';
66

7-
import AssetSettingsDialog from './AssetSettingsDialog';
8-
9-
import createTestBed from '../../../../../tests/_utils/TestBed';
7+
import createTestBed from 'tests/_utils/TestBed';
108
import {
119
withDecimalPlacesToken,
1210
zeroDecimalPlacesToken,
13-
} from '../../../../../tests/mocks/asset';
11+
} from 'tests/mocks/asset';
12+
13+
import AssetSettingsDialog from './AssetSettingsDialog';
1414

1515
describe('AssetSettingsDialog', () => {
1616
afterEach(() => cleanup());

source/renderer/app/components/wallet/tokens/wallet-token/WalletToken.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import React from 'react';
44
import noop from 'lodash/noop';
55
import { cleanup, screen, waitFor } from '@testing-library/react';
66

7-
import WalletToken from './WalletToken';
8-
9-
import createTestBed from '../../../../../../../tests/_utils/TestBed';
7+
import createTestBed from 'tests/_utils/TestBed';
108
import {
119
withDecimalPlacesToken,
1210
zeroDecimalPlacesToken,
13-
} from '../../../../../../../tests/mocks/asset';
11+
} from 'tests/mocks/asset';
12+
13+
import WalletToken from './WalletToken';
1414

1515
const DEFAULT_WALLET_PROPS = {
1616
isFavorite: false,

tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
"module": "commonjs", /* Specify what module code is generated. */
2828
// "rootDir": "./", /* Specify the root folder within your source files. */
2929
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
30-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
30+
"baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31+
"paths": {
32+
"tests/*": ["tests/*"]
33+
}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3234
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
3335
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
3436
// "types": [], /* Specify type package names to be included without being referenced in a source file. */

0 commit comments

Comments
 (0)