Get all platform unit tests to run
This commit is contained in:
1 parent
5544c57c37
commit
b8baae7c25
14 files changed
+114
-137
No files matched your search
@@ -1,22 +1,22 @@
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const webpack = require("webpack");
|
||||
const merge = require("webpack-merge");
|
||||
const path = require("path");
|
||||
const common = require("./webpack.common");
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
const INDEX = path.join(DIST_DIR, 'index.html');
|
||||
const SRC_DIR = path.join(__dirname, "../src");
|
||||
const DIST_DIR = path.join(__dirname, "../dist");
|
||||
const INDEX = path.join(DIST_DIR, "index.html");
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-source-map',
|
||||
mode: "development",
|
||||
devtool: "cheap-module-source-map",
|
||||
output: {
|
||||
path: DIST_DIR,
|
||||
publicPath: '/',
|
||||
filename: '[name].bundle.js',
|
||||
publicPath: "/",
|
||||
filename: "[name].bundle.js"
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@@ -24,26 +24,26 @@ module.exports = (env, argv) => {
|
||||
test: /\.(gif|jp?g|png|svg|ico)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: '[path][name].[ext]',
|
||||
context: SRC_DIR,
|
||||
},
|
||||
},
|
||||
],
|
||||
name: "[path][name].[ext]",
|
||||
context: SRC_DIR
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
name: "[name].[ext]"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [new webpack.HotModuleReplacementPlugin()],
|
||||
devServer: {
|
||||
@@ -52,11 +52,12 @@ module.exports = (env, argv) => {
|
||||
compress: false,
|
||||
// contentBase: DIST_DIR,
|
||||
open: true,
|
||||
port: 3001,
|
||||
port: 3000,
|
||||
writeToDisk: true,
|
||||
historyApiFallback: {
|
||||
index: '/',
|
||||
},
|
||||
},
|
||||
historyApiFallback: true
|
||||
// {
|
||||
// index: '/',
|
||||
// },
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,26 +1,14 @@
|
||||
const path = require("path");
|
||||
const base = require("../../jest.config.base.js");
|
||||
const pkg = require("./package");
|
||||
|
||||
module.exports = {
|
||||
verbose: true,
|
||||
testMatch: ["<rootDir>/src/**/*.test.js"],
|
||||
//
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: [
|
||||
"<rootDir>/src/**/*.{js,jsx}",
|
||||
"!<rootDir>/src/**/*.test.js",
|
||||
"!**/node_modules/**",
|
||||
"!**/__tests__/**"
|
||||
],
|
||||
reporters: ["default", "jest-junit"],
|
||||
//
|
||||
transform: {
|
||||
"^.+\\.js$": path.resolve(__dirname, "./jestBabelTransform.js")
|
||||
},
|
||||
moduleNameMapper: {
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
|
||||
"<rootDir>/src/__mocks__/fileMock.js",
|
||||
"\\.(css|less)$": "identity-obj-proxy"
|
||||
},
|
||||
setupFiles: ["<rootDir>../../node_modules/jest-canvas-mock/lib/index.js"],
|
||||
setupTestFrameworkScriptFile: "<rootDir>/src/__tests__/globalSetup.js"
|
||||
...base,
|
||||
name: pkg.name,
|
||||
displayName: pkg.name,
|
||||
setupFilesAfterEnv: ["<rootDir>/src/__tests__/globalSetup.js"]
|
||||
// rootDir: "../.."
|
||||
// testMatch: [
|
||||
// //`<rootDir>/platform/${pack.name}/**/*.spec.js`
|
||||
// "<rootDir>/platform/viewer/**/*.test.js"
|
||||
// ]
|
||||
};
|
||||
@@ -14,15 +14,13 @@
|
||||
"proxy": "http://localhost:8042",
|
||||
"scripts": {
|
||||
"lerna:start": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d",
|
||||
"lerna:test:unit": "jest --ci --runInBand --collectCoverage --reporters=default --reporters=jest-junit && codecov",
|
||||
"cm": "npx git-cz",
|
||||
"lerna:test:unit": "jest --ci --runInBand --collectCoverage && codecov -F viewer",
|
||||
"dev": "yarn run preBuild && react-scripts start",
|
||||
"dev:debug": "react-scripts start",
|
||||
"build:package": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
||||
"build:package:ci": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
||||
"build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build",
|
||||
"build:demo:ci": "yarn run preBuild && cross-env PUBLIC_URL=/ REACT_APP_CONFIG=config/demo.js react-scripts --max_old_space_size=4096 build",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}",
|
||||
"test:unit": "jest",
|
||||
"test:e2e:ci": "start-server-and-test start http://localhost:5000 cy:run:ci",
|
||||
"start": "yarn run dev",
|
||||
|
||||
Reference in new issue
Block a user