Kaynağa Gözat

Add `@modules` alias to frontend test module resolver (#33491)

GitOrigin-RevId: 929180b0887695b0d04456cfa66ccf87b4cd51c0
Alf Eaton 3 ay önce
ebeveyn
işleme
8be321fd73
1 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. 11 1
      services/web/test/frontend/bootstrap.js

+ 11 - 1
services/web/test/frontend/bootstrap.js

@@ -1,7 +1,17 @@
 // Run babel on tests to allow support for import/export statements in Node
 // Run babel on tests to allow support for import/export statements in Node
 require('@babel/register')({
 require('@babel/register')({
   extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
   extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
-  plugins: [['module-resolver', { alias: { '^@/(.+)': './frontend/js/\\1' } }]],
+  plugins: [
+    [
+      'module-resolver',
+      {
+        alias: {
+          '^@/(.+)': './frontend/js/\\1',
+          '^@modules/(.+)': './modules/\\1',
+        },
+      },
+    ],
+  ],
 })
 })
 
 
 // Load JSDOM to mock the DOM in Node
 // Load JSDOM to mock the DOM in Node