Skip to content

Commit

Permalink
test: reduce CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
EnixCoda committed Jun 14, 2023
1 parent 0f3857e commit 8901dac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions __tests__/jest.non-parallel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const baseConfig = require('./jest.config')

/**
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
...baseConfig,
maxWorkers: 1,
testMatch: [...baseConfig.testMatch, '**/__tests__/cases/non-parallel/*.ts?(x)'],
setupFilesAfterEnv: ['<rootDir>/setup.ts'],
}
1 change: 1 addition & 0 deletions __tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.retryTimes(3)
2 changes: 2 additions & 0 deletions src/utils/getSafeWidth.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { getSafeWidth, MINIMAL_CONTENT_VIEWPORT_WIDTH, MINIMAL_WIDTH } from './getSafeWidth'

jest.retryTimes(3) // Math.random may result in failure due to floating point precision

it(`should shrink when window is being resized smaller`, () => {
const randomGrow = 100 * Math.random()
expect(
Expand Down

0 comments on commit 8901dac

Please sign in to comment.