Upgrade to Jest 29 (#143319)

https://jestjs.io/blog/2022/04/25/jest-28
https://jestjs.io/blog/2022/08/25/jest-29

- jest.useFakeTimers('legacy') -> jest.useFakeTimers({ legacyFakeTimers:
true });
- jest.useFakeTimers('modern'); -> jest.useFakeTimers();
- tests can either use promises or callbacks, but not both
- test runner jasmine is no longer included, switch all suites to
jest-circus

Co-authored-by: Andrew Tate <andrew.tate@elastic.co>
This commit is contained in:
Jonathan Budzenski 2022-11-18 09:40:16 -06:00 committed by GitHub
parent ab2eb9db28
commit 2ac7ebe3bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
264 changed files with 1314 additions and 983 deletions

View file

@ -90,7 +90,7 @@ describe('dateMath', function () {
let now;
beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
mmnt = moment(anchor);
@ -128,7 +128,7 @@ describe('dateMath', function () {
let anchored;
beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
@ -166,7 +166,7 @@ describe('dateMath', function () {
let anchored;
beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
@ -205,7 +205,7 @@ describe('dateMath', function () {
let anchored;
beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);
@ -247,7 +247,7 @@ describe('dateMath', function () {
let anchored;
beforeEach(function () {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(unix);
now = moment();
anchored = moment(anchor);