From 18469324f9342c930c97adf303a37276131819d9 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:46:46 +0300 Subject: [PATCH] Add alias resolution to Jest --- rsconcept/frontend/package.json | 5 ++++- .../frontend/src/components/RSInput/rslang/parser.test.ts | 3 ++- .../frontend/src/components/RefsInput/parse/parser.test.ts | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rsconcept/frontend/package.json b/rsconcept/frontend/package.json index 73e8c5e3..97e31fca 100644 --- a/rsconcept/frontend/package.json +++ b/rsconcept/frontend/package.json @@ -67,6 +67,9 @@ }, "transformIgnorePatterns": [ "node_modules/(?!variables/.*)" - ] + ], + "moduleNameMapper": { + "^@/(.*)$": "/src/$1" + } } } diff --git a/rsconcept/frontend/src/components/RSInput/rslang/parser.test.ts b/rsconcept/frontend/src/components/RSInput/rslang/parser.test.ts index 366c6396..6e9b8826 100644 --- a/rsconcept/frontend/src/components/RSInput/rslang/parser.test.ts +++ b/rsconcept/frontend/src/components/RSInput/rslang/parser.test.ts @@ -1,4 +1,5 @@ -import { printTree } from '../../../utils/codemirror'; +import { printTree } from '@/utils/codemirror'; + import { parser } from './parser'; const testData = [ diff --git a/rsconcept/frontend/src/components/RefsInput/parse/parser.test.ts b/rsconcept/frontend/src/components/RefsInput/parse/parser.test.ts index 26d19865..a873f382 100644 --- a/rsconcept/frontend/src/components/RefsInput/parse/parser.test.ts +++ b/rsconcept/frontend/src/components/RefsInput/parse/parser.test.ts @@ -1,4 +1,5 @@ -import { printTree } from '../../../utils/codemirror'; +import { printTree } from '@/utils/codemirror'; + import { parser } from './parser'; const testData = [