Posts

Showing posts with the label mocha-webpack

how to separate files for mocha-webpack

Image
Clash Royale CLAN TAG #URR8PPP how to separate files for mocha-webpack What's happening is that when I run my tests, my coverage only shows bundle.js which isn't that helpful. bundle.js I have the following webpack file setup and wanted to know what I should change to make it so that each file is covered individually webpack.config-test.js var nodeExternals = require("webpack-node-externals") const path = require("path") module.exports = { context: path.resolve(__dirname), resolve: { extensions: [".js"], alias: { "@": path.join(__dirname, "../../src/server"), } }, output: { path: "./", filename: "[name].js", }, target: "node", // webpack should compile node compatible code externals: [nodeExternals()], // in order to ignore all modules in node_modules folder } running the command via npm: nyc mocha-webpack --webpack-...