Coder Social home page Coder Social logo

Comments (2)

thorakmedichi avatar thorakmedichi commented on June 11, 2024

Even if you can guide me on how to use --detectOpenHandles

I cant seem to run just jest as I keep getting ReferenceError: babelHelpers is not defined on every test

from re-start.

thorakmedichi avatar thorakmedichi commented on June 11, 2024

So for anyone following this I hacked this to solve my issue for now. I decided to just go around the entire re-start setup to solve the issue. It was the only way I could solve it with no direction from the repo owners.

So I changed package.json script test to be jest instead of npm run test:native && npm run test:web

Then I created my own jest.config.js file and put it in my root dir

/* eslint-disable max-len, quote-props */

// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
    notify: true,

    // A preset that is used as a base for Jest's configuration
    // preset: 'react-native-web',

    // The test environment that will be used for testing
    testEnvironment: 'node',

    // Automatically clear mock calls and instances between every test
    clearMocks: true,

    // The directory where Jest should output its coverage files
    coverageDirectory: 'coverage',
    // An array of regexp pattern strings used to skip coverage collection
    coveragePathIgnorePatterns: [
        '/node_modules/',
        '/prop-definitions/',
        '/images/',
        '/styles/',
        '/test-data/',
        '/mocks/',
        '/action-types/'
    ],

    // A map from regular expressions to paths to transformers
    transform: {
        // '^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js'
        '^.+\\.jsx?$': 'babel-jest',
    },

    // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
    transformIgnorePatterns: [
        // 'node_modules/(?!(jest-)?react-native|react-navigation)',
        'node_modules/(?!react-(.*-)?native(-.*)?)'
    ],

    testPathIgnorePatterns: [
        '/fixtures/',
        '/scripts/'
    ],
    moduleNameMapper: {
        // '.*\\.(svg|png|jpg|gif|ttf)$': '<rootDir>/flow/stub/url-loader.js',
        // 'react-native': '<rootDir>/node_modules/react-native-web',
        '^react-native$': 'react-native-web',
        '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'identity-obj-proxy'
    },
    moduleFileExtensions: [
        'web.js',
        'js',
        'json'
    ]
};

Then for gitlab runner I use yarn jest --ci --detectOpenHandles --maxWorkers=10 --forceExit

from re-start.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.