Unverified Commit d0994cae authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Configure support for absolute imports (#93)

* Update configs + a few imports for testing, fix misnamed files

* Some cleanup
parent 73ed1dd7
......@@ -25,6 +25,7 @@ module.exports = {
'^.+\\.(css|scss)$': '<rootDir>/node_modules/jest-css-modules',
},
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(j|t)sx?$',
moduleDirectories: ['node_modules', 'js'],
moduleFileExtensions: [
'ts',
'tsx',
......
import * as React from 'react';
import InfoButton from "../../InfoButton";
import InfoButton from 'components/common/InfoButton';
// TODO: Use css-modules instead of 'import'
import './styles.scss';
......
......@@ -2,7 +2,7 @@ import * as React from 'react';
import { shallow } from 'enzyme';
import InfoButton from "../../../InfoButton";
import InfoButton from 'components/common/InfoButton';
import EntityCardSection, { EntityCardSectionProps } from '../';
describe('EntityCardSection', () => {
......
......@@ -3,7 +3,6 @@ import * as React from 'react';
import { shallow } from 'enzyme';
import Avatar from 'react-avatar';
import Flag from '../../../Flag';
import { Link } from 'react-router-dom';
import TableListItem, { TableListItemProps } from '../';
......
......@@ -3,7 +3,7 @@ import Avatar from 'react-avatar';
import { Link } from 'react-router-dom';
import { LoggingParams, UserResource} from '../types';
import Flag from '../../Flag';
import Flag from 'components/common/Flag';
export interface UserListItemProps {
user: UserResource;
......
......@@ -3,7 +3,7 @@ import * as React from 'react';
import { shallow } from 'enzyme';
import Avatar from 'react-avatar';
import Flag from '../../../Flag';
import Flag from 'components/common/Flag';
import { Link } from 'react-router-dom';
import UserListItem, { UserListItemProps } from '../';
......
......@@ -15,6 +15,11 @@
"noResolve": false,
"removeComments": true,
"types": ["jest"],
"baseUrl": "js",
"paths": {
"components/*": [ "components/*" ],
"ducks/*": [ "ducks/*" ],
}
},
"exclude": [
"node_modules",
......
......@@ -15,6 +15,10 @@ const config: webpack.Configuration = {
},
devtool: 'source-map',
resolve: {
alias: {
components: path.join(__dirname, '/js/components'),
ducks: path.join(__dirname, '/js/ducks'),
},
extensions: ['.tsx', '.ts', '.js', '.jsx', '.css', '.scss'],
},
module: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment