mocha-webpack没有找到测试

问题描述 投票:1回答:1

我似乎无法想象如何让mocha-webpack检测我的文件夹中的测试。我正在运行以下命令:

mocha-webpack --webpack-config test/server/webpack.config-test.js

webpack.config-test.js

var nodeExternals = require("webpack-node-externals")
const path = require("path")

function resolve(dir) 
{
    return path.join(__dirname, "..", dir)
}

module.exports = {
    context: path.resolve(__dirname),
    resolve: {
        extensions: [".js"],
        alias: {
            "vue$": "vue/dist/vue.esm.js",
            "@": resolve("src"),
        }
    },
    target: "node", // webpack should compile node compatible code
    externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
}

如果它有帮助,我也使用vue-cli,所以已经有webpack配置,也许我可以导入其中一个然后做一些小改动。

javascript node.js webpack mocha mocha-webpack
1个回答
1
投票

您需要将其添加到您的代码行:

mocha-webpack --webpack-config test/server/webpack.config-test.js \"src/**/*.js\"

© www.soinside.com 2019 - 2024. All rights reserved.