* add: medusa admin hooks + tests * fix: remove unneeded props * fix: deps * fix: deps * fix: deps * fix: failing tests * fix: failing tests * fix: query key * add: yarn workspaces * fix: linting medusa-react * fix: add prepare script * fix: buildOptions * fix: useAdminShippingOptions query * fix: use qs instead for query params (#1019) * fix: formatting * debug: ci pipeline * debug: log node_modules structure * debug: use lerna bootstrap * debug: update node version * debug: print pkgs in workspace * debug: print pkgs in workspace * debug: print pkgs in workspace * debug: print pkgs in workspace * debug: add explicit build step * fix: jsdoc * debug: run build step * debug: fix build errors * debug: add build step to integration tests * fix: failing test * cleanup Co-authored-by: Sebastian Rindom <seb@medusajs.com> Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
50 lines
1.6 KiB
JavaScript
50 lines
1.6 KiB
JavaScript
const path = require(`path`)
|
|
const glob = require(`glob`)
|
|
const fs = require(`fs`)
|
|
|
|
const pkgs = glob.sync(`./packages/*`).map((p) => p.replace(/^\./, `<rootDir>`))
|
|
|
|
const reMedusa = /medusa$/
|
|
const medusaDir = pkgs.find((p) => reMedusa.exec(p))
|
|
const medusaBuildDirs = [`dist`].map((dir) => path.join(medusaDir, dir))
|
|
const builtTestsDirs = pkgs
|
|
.filter((p) => fs.existsSync(path.join(p, `src`)))
|
|
.map((p) => path.join(p, `__tests__`))
|
|
const distDirs = pkgs.map((p) => path.join(p, `dist`))
|
|
const ignoreDirs = [].concat(
|
|
medusaBuildDirs,
|
|
builtTestsDirs,
|
|
distDirs,
|
|
"<rootDir>/packages/medusa-react/*"
|
|
)
|
|
|
|
const coverageDirs = pkgs.map((p) => path.join(p, `src/**/*.js`))
|
|
const useCoverage = !!process.env.GENERATE_JEST_REPORT
|
|
const projects = pkgs.map((pkg) => pkg.concat("/jest.config.js"))
|
|
|
|
module.exports = {
|
|
notify: true,
|
|
verbose: true,
|
|
roots: ["<rootDir>"],
|
|
projects: ["<rootDir>/packages/*/jest.config.js"],
|
|
modulePathIgnorePatterns: ignoreDirs,
|
|
coveragePathIgnorePatterns: ignoreDirs,
|
|
testPathIgnorePatterns: [
|
|
`<rootDir>/examples/`,
|
|
`<rootDir>/dist/`,
|
|
`<rootDir>/node_modules/`,
|
|
`__tests__/fixtures`,
|
|
],
|
|
//moduleNameMapper: {
|
|
// "^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
|
|
//},
|
|
//snapshotSerializers: [`jest-serializer-path`],
|
|
collectCoverageFrom: coverageDirs,
|
|
//reporters: process.env.CI
|
|
// ? [[`jest-silent-reporter`, { useDots: true }]].concat(
|
|
// useCoverage ? `jest-junit` : []
|
|
// )
|
|
// : [`default`].concat(useCoverage ? `jest-junit` : []),
|
|
// setupFiles: [`<rootDir>/.jestSetup.js`],
|
|
}
|