Skip to content

Commit

Permalink
Import jest-dom types
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisermann committed Aug 4, 2020
1 parent 5da6d70 commit 1af5fec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- `jest` and `@testing-library` typings.
- Typings for `jest-dom` matchers.

### Changed
- Remove unneeded dependencies
Expand Down
1 change: 1 addition & 0 deletions react.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { RenderOptions, RenderResult } from '@testing-library/react'
import { MockedProviderProps } from '@apollo/react-testing'
import * as hooks from '@testing-library/react-hooks'
import '@testing-library/jest-dom'

const { renderHook } = hooks

Expand Down
9 changes: 6 additions & 3 deletions react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ const paths = require('./modules/paths')
const pkg = require(paths.resolveAppPath('package.json'))

const getLocale = (optionsLocale) => {
const pkgLocale = pkg.vtexTestTools.defaultLocale
const languages = [optionsLocale, pkgLocale, 'en', 'en-US']
const locales = [
optionsLocale,
pkg.vtexTestTools && pkg.vtexTestTools.defaultLocale,
'en',
'en-US',
].filter(Boolean)

const locales = languages.filter((lang) => Boolean(lang))
const localeExists = (locale) =>
paths.pathExists(`../messages/${locale}.json`)

Expand Down

0 comments on commit 1af5fec

Please sign in to comment.