Skip to content

Commit

Permalink
fix: jest configs and utils fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
  • Loading branch information
tunnckoCore committed Sep 18, 2019
1 parent 6903b53 commit 71f5ece
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "@hela/fab"
}

This file was deleted.

2 changes: 1 addition & 1 deletion @tunnckocore/utils/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test('createAliases return correct aliases', () => {

// eslint-disable-next-line unicorn/consistent-function-scoping
const toAliases = (src) =>
['@hela/foo2', '@tunnckocore/qux'].reduce((acc, name) => {
['@hela/fab', '@tunnckocore/qux'].reduce((acc, name) => {
acc[name] = path.join(cwd, name, src);
return acc;
}, {});
Expand Down
2 changes: 1 addition & 1 deletion @tunnckocore/utils/dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function getWorkspacesAndExtensions(cwd = process.cwd()) {
const workspaces = [].concat(rootLerna.packages || rootPackage.workspaces || []).filter(x => typeof x === 'string').filter(Boolean).reduce((acc, ws) => acc.concat(ws.split(',')), []).map(ws => path.dirname(ws));
let exts = [].concat(rootPackage.extensions).filter(Boolean);

if (exts.length > 0) {
if (exts.length === 0) {
exts = ['ts', 'tsx', ...EXTENSIONS];
}

Expand Down
2 changes: 1 addition & 1 deletion @tunnckocore/utils/dist/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function getWorkspacesAndExtensions(cwd = process.cwd()) {
const workspaces = [].concat(rootLerna.packages || rootPackage.workspaces || []).filter(x => typeof x === 'string').filter(Boolean).reduce((acc, ws) => acc.concat(ws.split(',')), []).map(ws => path.dirname(ws));
let exts = [].concat(rootPackage.extensions).filter(Boolean);

if (exts.length > 0) {
if (exts.length === 0) {
exts = ['ts', 'tsx', ...EXTENSIONS];
}

Expand Down
2 changes: 1 addition & 1 deletion @tunnckocore/utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function getWorkspacesAndExtensions(cwd = process.cwd()) {

let exts = [].concat(rootPackage.extensions).filter(Boolean);

if (exts.length > 0) {
if (exts.length === 0) {
exts = ['ts', 'tsx', ...EXTENSIONS];
}
exts = exts.map((extension) =>
Expand Down
11 changes: 10 additions & 1 deletion jest.build.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const utils = require('./@tunnckocore/utils/src');

const { alias, exts } = utils.createAliases();

module.exports = {
displayName: 'build',
rootDir: __dirname,
Expand All @@ -7,7 +11,12 @@ module.exports = {
],
testPathIgnorePatterns: [
/node_modules/.toString(),
/.+\/fixtures\/.+/.toString(),
/.+\/fixtures?\/.+/.toString(),
/.+\/__fixtures?__\/.+/.toString(),
/.+\/support\/.+/.toString(),
/.+\/__support__\/.+/.toString(),
],
moduleNameMapper: alias,
moduleFileExtensions: exts,
runner: './@tunnckocore/jest-runner-babel/dist/main/index.js',
};
11 changes: 10 additions & 1 deletion jest.lint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const utils = require('./@tunnckocore/utils/src');

const { alias, exts } = utils.createAliases();

module.exports = {
displayName: 'lint',
rootDir: __dirname,
Expand All @@ -7,7 +11,12 @@ module.exports = {
],
testPathIgnorePatterns: [
/node_modules/.toString(),
/.+\/fixtures\/.+/.toString(),
/.+\/fixtures?\/.+/.toString(),
/.+\/__fixtures?__\/.+/.toString(),
/.+\/support\/.+/.toString(),
/.+\/__support__\/.+/.toString(),
],
moduleNameMapper: alias,
moduleFileExtensions: exts,
runner: './@tunnckocore/jest-runner-eslint/dist/main/index.js',
};

0 comments on commit 71f5ece

Please sign in to comment.