Kaynağa Gözat

use absolute path to make sure running tests is OK even if it is in node_modules of other project (#2685)

flytreeleft 10 yıl önce
ebeveyn
işleme
1538cdda25
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      build/webpack.test.config.js

+ 6 - 1
build/webpack.test.config.js

@@ -17,7 +17,12 @@ module.exports = {
       {
         test: /\.js$/,
         loader: 'babel',
-        exclude: /test\/unit|node_modules/
+        // NOTE: use absolute path to make sure
+        // running tests is OK even if it is in node_modules of other project
+        exclude: [
+          path.resolve(__dirname, '../test/unit'),
+          path.resolve(__dirname, '../node_modules')
+        ]
       }
     ]
   },