Skip to content

Commit

Permalink
Fix JEST
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Feb 6, 2023
1 parent 71a2e00 commit 8fbd6d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
18 changes: 16 additions & 2 deletions jest.config.js
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { resolve } = require('path')
const { resolve, join } = require('path')
const { pathsToModuleNameMapper } = require('ts-jest')
const fs = require('fs')
const CI = !!process.env.CI

const ROOT_DIR = __dirname
Expand Down Expand Up @@ -41,6 +42,19 @@ if (process.env.LEAKS_TEST === 'true') {

testMatch.push('!**/dist/**', '!**/.bob/**')

const bobPath = require.resolve('bob-the-bundler/package.json').replace('package.json', '')
const jestResolverPath = join(
bobPath,
'jest-resolver.js',
)

const jestResolverContent = fs.readFileSync(jestResolverPath, 'utf-8')

fs.writeFileSync(join(
bobPath,
'jest-resolver.cjs',
), jestResolverContent)

module.exports = {
testEnvironment: 'node',
rootDir: ROOT_DIR,
Expand All @@ -54,5 +68,5 @@ module.exports = {
cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`),
testMatch,
testTimeout,
resolver: 'bob-the-bundler/jest-resolver.js',
resolver: 'bob-the-bundler/jest-resolver.cjs',
}
13 changes: 0 additions & 13 deletions package.json
Expand Up @@ -2,7 +2,6 @@
"name": "graphql-yoga-monorepo",
"private": true,
"scripts": {
"align-workspaces": "node scripts/align-workspaces.js",
"prebuild": "rimraf packages/*/dist",
"check": "pnpm -r --filter=!example-deno run check",
"build": "pnpm --filter=@graphql-yoga/graphiql run build && pnpm --filter=@graphql-yoga/render-graphiql run build && pnpm --filter=graphql-yoga run generate-graphiql-html && bob build",
Expand Down Expand Up @@ -48,18 +47,6 @@
"bugs": {
"url": "https://github.com/dotansimha/graphql-yoga/issues"
},
"workspaces": [
"packages/*",
"packages/plugins/*",
"packages/client/*",
"packages/event-target/*",
"examples/**/*",
"!packages/**/dist",
"!examples/**/dist",
"benchmark/*",
"website",
"e2e"
],
"homepage": "https://github.com/dotansimha/graphql-yoga#readme",
"devDependencies": {
"@babel/core": "7.20.12",
Expand Down
11 changes: 0 additions & 11 deletions scripts/align-workspaces.js

This file was deleted.

0 comments on commit 8fbd6d6

Please sign in to comment.