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

chore(deps-dev): bump ts-jest from 26.5.6 to 29.2.5 #1109

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55,338 changes: 23,973 additions & 31,365 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@babel/preset-react": "^7.24.7",
"@types/create-hash": "^1.2.6",
"@types/enzyme": "^3.10.12",
"@types/jest": "^26.0.24",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.6",
"@types/node": "^18.19.33",
"@types/react": "^17.0.39",
Expand All @@ -84,7 +84,8 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"jest-enzyme": "^7.1.0",
"jest-environment-jsdom": "29.7.0",
"jest-enzyme": "^7.1.2",
"jest-websocket-mock": "^2.5.0",
"lint-staged": "^15.2.10",
"mock-socket": "^9.1.5",
Expand All @@ -103,14 +104,11 @@
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.1.0",
"stylelint-scss": "^5.3.2",
"ts-jest": "^26.5.6",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"xrpl": "^3.1.0"
},
"resolutions": {
"jest-environment-jsdom": "29.3.1"
},
"lint-staged": {
"src/**/*.{js,jsx,json,scss}": [
"prettier --write",
Expand Down
6 changes: 2 additions & 4 deletions src/containers/Amendment/test/amendment-summary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Amendments Page container', () => {
wrapper.unmount()
})

it('renders all parts for a voting amendment', async (done) => {
it('renders all parts for a voting amendment', async () => {
moxios.stubRequest(
`${process.env.VITE_DATA_URL}/amendment/vote/main/${MOCK_IDENTIFIER}`,
{
Expand Down Expand Up @@ -200,10 +200,9 @@ describe('Amendments Page container', () => {
).toBe(4)

wrapper.unmount()
done()
})

it('renders 404 page on no match', async (done) => {
it('renders 404 page on no match', async () => {
moxios.stubRequest(
`${process.env.VITE_DATA_URL}/amendment/vote/main/${MOCK_IDENTIFIER}`,
{
Expand All @@ -225,6 +224,5 @@ describe('Amendments Page container', () => {

expect(wrapper.find('.no-match').length).toBe(1)
wrapper.unmount()
done()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ describe('NetworkPicker component', () => {
const createWrapper = (localNetworks?: string[]) => {
let Picker

jest.unmock('../NetworkPicker')
// Needed to test different env variable values.
jest.isolateModules(() => {
;({ NetworkPicker: Picker } = jest.requireActual('../NetworkPicker'))
const module = jest.requireActual('../NetworkPicker')
Picker = module.NetworkPicker
})

localStorage.removeItem(CUSTOM_NETWORKS_STORAGE_KEY)
Expand Down
14 changes: 7 additions & 7 deletions src/containers/Token/DEXPairs/test/hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ describe('Testing hooks', () => {
})

it('renders all pairs', (done) => {
setImmediate(() => {
setTimeout(() => {
wrapper.update()
const allPairs = wrapper.find('.pair')
// 3 from the mockTopEndpoint and 3 from hardcoded pairs
expect(allPairs.length).toEqual(6)
done()
})
}, 0)
})
it('renders all PairStats components', (done) => {
setImmediate(() => {
setTimeout(() => {
wrapper.update()
const allLows = wrapper.find('.low')
const allHighs = wrapper.find('.high')
expect(allLows.length).toEqual(12)
expect(allHighs.length).toEqual(12)
done()
})
}, 0)
})
})

Expand All @@ -106,13 +106,13 @@ describe('Testing hooks', () => {
})

it('renders on top tokens failure', (done) => {
// setImmediate will execute the callback immediately after all queued promise callbacks are executed
setImmediate(() => {
// setTimeout will execute the callback immediately after all queued promise callbacks are executed
setTimeout(() => {
wrapper.update()
const noTokensNode = wrapper.find('.no-pairs-message')
expect(noTokensNode.length).toEqual(1)
done()
})
}, 0)
})
})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { mount } from 'enzyme'
import { DropdownItem } from '../DropdownItem'
import createSpy = jasmine.createSpy

describe('DropdownItem', () => {
describe(`prop: className`, () => {
Expand All @@ -14,7 +13,7 @@ describe('DropdownItem', () => {

describe('prop: handler', () => {
let wrapper
const handler = createSpy('handler')
const handler = jest.fn()

beforeEach(() => {
wrapper = mount(<DropdownItem handler={handler}>Hello</DropdownItem>)
Expand Down
2 changes: 1 addition & 1 deletion src/containers/test/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { testQueryClient } from './QueryClient'
import { AnalyticsSetPath } from '../shared/analytics'

export function flushPromises() {
return new Promise((resolve) => setImmediate(resolve))
return new Promise((resolve) => setTimeout(resolve, 0))
}

// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion testUtils/cssTransform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
process() {
return 'module.exports = {};'
return { code: 'module.exports = {};' }
},
getCacheKey() {
// The output is always the same.
Expand Down
2 changes: 1 addition & 1 deletion testUtils/imageTransform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
process() {
return 'module.exports = {};'
return { code: 'module.exports = {};' }
},
getCacheKey() {
// The output is always the same.
Expand Down
6 changes: 4 additions & 2 deletions testUtils/svgTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = {
process(_src, filename) {
const assetFilename = JSON.stringify(path.basename(filename))

return `const React = require('react');
return {
code: `const React = require('react');
module.exports = React.forwardRef((props, ref) => {
return {
$$typeof: Symbol.for('react.element'),
Expand All @@ -18,6 +19,7 @@ module.exports = {
children: ${assetFilename}
})
};
});`
});`,
}
},
}
Loading