From 05b85404e7ce39460bba81c0420540fbf7738fe8 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Sun, 15 Dec 2024 03:26:24 +0800 Subject: [PATCH] rm --- .eslintrc.js | 1 - jest.config.base.js | 54 --------------------------------- resources/README.md | 12 -------- resources/jestBabelTransform.js | 14 --------- resources/runTests.js | 18 ----------- resources/test.config.js | 25 --------------- 6 files changed, 124 deletions(-) delete mode 100644 jest.config.base.js delete mode 100644 resources/jestBabelTransform.js delete mode 100644 resources/runTests.js delete mode 100644 resources/test.config.js diff --git a/.eslintrc.js b/.eslintrc.js index f3f041745a7..35a9cf376a5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -435,7 +435,6 @@ module.exports = { '**/__tests__/**', 'webpack.config.js', '**/tests/**', - 'test.config.js', 'vitest.config.mts', 'setup-files.ts', ], diff --git a/jest.config.base.js b/jest.config.base.js deleted file mode 100644 index bd9f4ea9316..00000000000 --- a/jest.config.base.js +++ /dev/null @@ -1,54 +0,0 @@ -const path = require('node:path'); - -module.exports = (dir, env = 'jsdom') => { - const package = require(`${dir}/package.json`); - const setupFilesAfterEnv = []; - if (env === 'jsdom') { - setupFilesAfterEnv.push(path.join(__dirname, '/resources/test.config.js')); - } - return { - globals: { - 'ts-jest': { - tsConfig: `${__dirname}/resources/tsconfig.base.esm.json`, - }, - }, - clearMocks: true, - collectCoverage: true, - coverageDirectory: `${__dirname}/coverage/jest`, - setupFilesAfterEnv, - moduleNameMapper: { - '\\.css$': 'identity-obj-proxy', - '^graphql-language-service-([^/]+)': `${__dirname}/packages/graphql-language-service/src/$1`, - '^graphql-language-([^/]+)': `${__dirname}/packages/graphql-language-$1/src`, - '^@graphiql\\/([^/]+)': `${__dirname}/packages/graphiql-$1/src`, - '^codemirror-graphql\\/esm([^]+)\\.js': `${__dirname}/packages/codemirror-graphql/src/$1`, - '^codemirror-graphql\\/cjs([^]+)': `${__dirname}/packages/codemirror-graphql/src/$1`, - // relies on compilation - '^cm6-graphql\\/src\\/([^]+)': `${__dirname}/packages/cm6-graphql/dist/$1`, - // because of the svelte compiler's export patterns i guess? - 'svelte/compiler': `${__dirname}/node_modules/svelte/compiler.cjs`, - }, - testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'], - testEnvironment: env, - testPathIgnorePatterns: ['node_modules', 'dist', 'cypress'], - collectCoverageFrom: ['**/src/**/*.{js,jsx,ts,tsx}'], - transformIgnorePatterns: ['node_modules/(!@astrojs/compiler)'], - coveragePathIgnorePatterns: [ - 'dist', - 'esm', - 'node_modules', - '__tests__', - 'resources', - - 'examples', - '.d.ts', - 'types.ts', - ], - - roots: [''], - - rootDir: dir, - name: package.name, - displayName: package.name, - }; -}; diff --git a/resources/README.md b/resources/README.md index 690ea7f3574..60d44b023c3 100644 --- a/resources/README.md +++ b/resources/README.md @@ -2,18 +2,6 @@ ## Scripts invoked via `npm` and `yarn run` -### `buildFlow.js` - -For each `.js` file under `src`, creates a corresponding `.js.flow` file under -`dist`; these files are included in the published NPM packages, so that -codebases can consume the Flow types. This script is invoked via -`yarn run build-flow` (and also `yarn run build`). - -### `buildJs.js` - -Compiles `.js` files under `src` using Babel, writing the output to `dist`. This -script is invoked via `yarn run build-js` (and also `yarn run build`). - ### `pretty.js` Prettifies the code base, or tests that it is already prettified. This script is diff --git a/resources/jestBabelTransform.js b/resources/jestBabelTransform.js deleted file mode 100644 index 9d24ac94e59..00000000000 --- a/resources/jestBabelTransform.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) 2021 GraphQL Contributors. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -const babelJest = require('babel-jest'); - -// thanks to @bobbybobby! -// https://github.com/facebook/jest/issues/7359#issuecomment-471509996 - -module.exports = babelJest.createTransformer({ - rootMode: 'upward', -}); diff --git a/resources/runTests.js b/resources/runTests.js deleted file mode 100644 index 0d0cd7029b2..00000000000 --- a/resources/runTests.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; -const path = require('node:path'); -const { exec } = require('./util'); - -exec( - 'jest', - '--config', - path.join(__dirname, '../', 'jest.config.js'), - '--rootDir', -); diff --git a/resources/test.config.js b/resources/test.config.js deleted file mode 100644 index b528b4a5b7d..00000000000 --- a/resources/test.config.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2021 GraphQL Contributors. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -import '@testing-library/jest-dom'; - -document.createRange = function () { - return { - setEnd() {}, - setStart() {}, - getClientRects() { - return { top: 0, bottom: 0, left: 0, right: 0 }; - }, - getBoundingClientRect() { - return { right: 0 }; - }, - }; -}; - -process.on('unhandledRejection', error => { - console.error('Unhandled Promise Rejection:'); - console.error(error.stack); -});