Skip to content

Commit

Permalink
ignore pattern with monorepo packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcwoshizz committed Apr 13, 2023
1 parent 2d080ae commit 157c130
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-olives-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zcloak/dev": patch
---

ignore pattern with monorepo packages
13 changes: 6 additions & 7 deletions packages/dev/config/jest.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// Copyright 2021-2023 zcloak authors & contributors
// SPDX-License-Identifier: Apache-2.0

const fs = require('fs');
const path = require('path');
const { defaults } = require('jest-config');

const { getPackagesSync } = require('@manypkg/get-packages');

const { packages } = getPackagesSync(process.cwd());

module.exports = {
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
modulePathIgnorePatterns: ['<rootDir>/build'].concat(
fs
.readdirSync('packages')
.filter((p) => fs.statSync(`packages/${p}`).isDirectory())
.map((p) => `<rootDir>/packages/${p}/build`)
),
modulePathIgnorePatterns: packages.map((pkg) => path.join(pkg.dir, 'build')),
// custom resolver to do TS-like imports
resolver: require.resolve('./jest-resolver.cjs'),
// See https://jestjs.io/docs/configuration#extraglobals-arraystring
Expand Down

0 comments on commit 157c130

Please sign in to comment.