2019-10-09 10:19:46 +02:00
|
|
|
const path = require("path");
|
|
|
|
|
const rootDir = path.resolve(__dirname, "..");
|
|
|
|
|
const reportDirectory = path.join(rootDir, "target", "jest-reports");
|
2019-10-11 14:09:22 +02:00
|
|
|
const mockDirectory = path.resolve(__dirname, "src", "__mocks__");
|
2019-10-09 10:19:46 +02:00
|
|
|
|
2019-10-13 12:25:05 +02:00
|
|
|
// Set timezone for tests, this is required to get same date values
|
|
|
|
|
// accross diferent machines such ci-server and dev box.
|
|
|
|
|
// We have to set the timezone as soon as possible, because Date will
|
|
|
|
|
// cache the value.
|
|
|
|
|
// @see https://stackoverflow.com/questions/56261381/how-do-i-set-a-timezone-in-my-jest-config
|
|
|
|
|
process.env.TZ = "Europe/Berlin";
|
|
|
|
|
|
2019-10-09 10:19:46 +02:00
|
|
|
module.exports = {
|
|
|
|
|
rootDir,
|
2019-10-11 14:09:22 +02:00
|
|
|
transform: {
|
|
|
|
|
"^.+\\.js$": "@scm-manager/jest-preset"
|
|
|
|
|
},
|
|
|
|
|
moduleNameMapper: {
|
|
|
|
|
"\\.(png|svg|jpg|gif|woff2?|eot|ttf)$": path.join(
|
|
|
|
|
mockDirectory,
|
|
|
|
|
"fileMock.js"
|
|
|
|
|
),
|
|
|
|
|
"\\.(css|scss|sass)$": path.join(mockDirectory, "styleMock.js")
|
|
|
|
|
},
|
|
|
|
|
setupFiles: [path.resolve(__dirname, "src", "setup.js")],
|
2019-10-09 10:19:46 +02:00
|
|
|
collectCoverage: true,
|
|
|
|
|
coverageDirectory: path.join(reportDirectory, "coverage"),
|
|
|
|
|
coveragePathIgnorePatterns: ["src/tests/.*"],
|
|
|
|
|
reporters: [
|
|
|
|
|
"default",
|
|
|
|
|
[
|
|
|
|
|
"jest-junit",
|
2019-10-09 11:22:16 +02:00
|
|
|
{
|
|
|
|
|
suiteName: "SCM-UI Package tests",
|
|
|
|
|
outputDirectory: reportDirectory,
|
|
|
|
|
outputName: "TEST-scm-ui.xml"
|
|
|
|
|
}
|
2019-10-09 10:19:46 +02:00
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
};
|