npm.io
0.0.1-alpha.0 • Published 4 years ago

@guidecx/config-jest

Licence
ISC
Version
0.0.1-alpha.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0

GCX Jest Config

This module contains the configuration files for Jest that are used by all GuideCX applications.

As with many of our other packages, you'll need to make sure you have the proper devDependencies installed for this library to have any effect. For this package you'll need:

  • jest
  • jest-transform-graphql
  • babel-jest
  • jest-environment-jsdom-fifteen
  • jest-watch-typeahead

Some of the config options require special packages, other than the packages previously mentioned. If not using these packages, such as those related to graphql, override the relevant properties on the config options object. For example:

import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
  ...require('../config-jest'),
  setupFiles: [],
  setupFilesAfterEnv: [],
  transform: {
    '\\.[jt]sx?

Installing library into another project

We have 2 variant files that are exposed to other applications; express and react. Depending on the type of application you're importing configurations too, you can do the following in your jest.config.js file:

module.exports = {
  ...require('@guidecx/config-jest/react'),
  // overwrite config options as-needed
};

Once this is complete, verify that you have the following configuration options in your package.json:

"scripts": {
  "test": "jest"
}
: 'babel-jest', '^.+\\.(ts|tsx)

Installing library into another project

We have 2 variant files that are exposed to other applications; __INLINE_CODE_7__ and __INLINE_CODE_8__. Depending on the type of application you're importing configurations too, you can do the following in your __INLINE_CODE_9__ file:

__CODE_BLOCK_1__

Once this is complete, verify that you have the following configuration options in your __INLINE_CODE_10__:

__CODE_BLOCK_2__
: 'ts-jest', }, }; export default config;

Installing library into another project

We have 2 variant files that are exposed to other applications; __INLINE_CODE_7__ and __INLINE_CODE_8__. Depending on the type of application you're importing configurations too, you can do the following in your __INLINE_CODE_9__ file:

__CODE_BLOCK_1__

Once this is complete, verify that you have the following configuration options in your __INLINE_CODE_10__:

__CODE_BLOCK_2__