Skip to content

Commit

Permalink
get user jest config from archetype (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored Jun 4, 2018
1 parent 22f24ff commit 1604583
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const Path = require("path");
const optionalRequire = require("optional-require")(require);

const rootDir = process.cwd();
"use strict";

const Path = require("path");
const fileMock = Path.join(__dirname, "__mocks__", "file-mock.js");
const frameworkMock = Path.join(__dirname, "__mocks__", "framework-mock.js");

const userConfig = optionalRequire(Path.resolve("archetype", "config"), {
default: {}
});
const archetype = require("electrode-archetype-react-app/config/archetype");

const rootDir = process.cwd();

const jestDefaultConfig = {
rootDir,
Expand All @@ -23,4 +21,4 @@ const jestDefaultConfig = {
modulePathIgnorePatterns: ["<rootDir>/test"]
};

module.exports = Object.assign({}, jestDefaultConfig, userConfig.jest);
module.exports = Object.assign({}, jestDefaultConfig, archetype.jest);
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ module.exports = {
devDir,
devPath: devDir,
devRequire: require("../require"),
webpack: xenvConfig(webpackConfigSpec, userConfig.webpack)
webpack: xenvConfig(webpackConfigSpec, userConfig.webpack),
jest: Object.assign({}, userConfig.jest)
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const Path = require("path");
const optionalRequire = require("optional-require")(require);

const rootDir = process.cwd();
"use strict";

const Path = require("path");
const fileMock = Path.join(__dirname, "__mocks__", "file-mock.js");
const frameworkMock = Path.join(__dirname, "__mocks__", "framework-mock.js");

const userConfig = optionalRequire(Path.resolve("archetype", "config"), {
default: {}
});
const archetype = require("electrode-archetype-react-component/config/archetype");

const rootDir = process.cwd();

const jestDefaultConfig = {
rootDir,
Expand All @@ -23,4 +21,4 @@ const jestDefaultConfig = {
modulePathIgnorePatterns: ["<rootDir>/test", "<rootDir>/lib"]
};

module.exports = Object.assign({}, jestDefaultConfig, userConfig.jest);
module.exports = Object.assign({}, jestDefaultConfig, archetype.jest);

0 comments on commit 1604583

Please sign in to comment.