Update tests for Jest v28, apply uuid hack

https://github.com/uuidjs/uuid/pull/616#issuecomment-1111012599
This commit is contained in:
Alex Gleason 2022-07-09 14:25:19 -05:00
parent 0dc9478600
commit 8bcf5fe82d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import {
Map as ImmutableMap,
OrderedSet as ImmutableOrderedSet,
fromJS,
is,
} from 'immutable';
import { STATUS_IMPORT } from 'soapbox/actions/importer';
@ -111,7 +112,7 @@ describe('contexts reducer', () => {
}) as ImmutableMap<string, ImmutableOrderedSet<string>>,
});
expect(reducer(state, action)).toEqual(expected);
expect(is(reducer(state, action), expected)).toBe(true);
});
});
});

View File

@ -33,6 +33,10 @@ module.exports = {
'<rootDir>/node_modules',
'<rootDir>/app',
],
'moduleNameMapper': {
// https://github.com/uuidjs/uuid/pull/616#issuecomment-1111012599
'^uuid$': require.resolve('uuid'),
},
'testMatch': ['**/*/__tests__/**/?(*.|*-)+(test).(ts|js)?(x)'],
'testEnvironment': 'jsdom',
'transformIgnorePatterns': [