Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clients): generate jest.config.js #2172

Merged
merged 6 commits into from
Mar 25, 2021

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Mar 24, 2021

Issue

Refs: #1618
Alternative to #2163

Description

Generate jest.config.js per client instead of extending from global config

Testing

CI


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr changed the title chore: remove comment about ts-jest from global jest config fix(clients): generate jest.config.js Mar 24, 2021
@trivikr trivikr force-pushed the clients-optional-jest-config branch from 9e3cda9 to 498def1 Compare March 24, 2021 18:48
Currently mocha is used in these clients. We need to come up with
cross platform testing infrastructure story for clients in future.
@trivikr trivikr force-pushed the clients-optional-jest-config branch from 498def1 to e909261 Compare March 24, 2021 19:20
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: e909261
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@trivikr trivikr requested a review from alexforsyth March 25, 2021 15:46
Copy link
Contributor

@alexforsyth alexforsyth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see, LGTM

@trivikr trivikr merged commit 95b0e19 into aws:main Mar 25, 2021
@trivikr trivikr deleted the clients-optional-jest-config branch March 25, 2021 17:26
@G-Rath
Copy link

G-Rath commented Mar 28, 2021

btw jest supports jest.config.ts & ts-jest extends @jest/types types for its global options, i.e

import { Config } from '@jest/types';
import 'ts-jest';

const config: Config.InitialOptions = {
  globals: {
    'ts-jest': {
      // disable type checking when running tests, speeding them up and making
      // the development experience nicer by not blocking tests on types
      isolatedModules: true
    }
  },

  testEnvironment: 'jsdom',
  setupFilesAfterEnv: [
    '@testing-library/jest-dom/extend-expect',
    './test/setupExpectEachTestHasAssertions.ts'
  ],

  clearMocks: true,
  restoreMocks: true,
  resetMocks: true,

  testRunner: 'jest-circus/runner',

  transformIgnorePatterns: [/<rootDir>\/node_modules\/(?!(ky\/))/u.source],
  transform: {
    [/ky\/index\.js/u.source]: 'ts-jest',
    [/\.tsx?/u.source]: 'ts-jest'
  }
};

export default config;

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants