Skip to content

Commit

Permalink
Update tests for Jest v28, apply uuid hack
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleason committed Jul 9, 2022
1 parent 0dc9478 commit 8bcf5fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/soapbox/reducers/__tests__/contexts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Map as ImmutableMap,
OrderedSet as ImmutableOrderedSet,
fromJS,
is,
} from 'immutable';

import { STATUS_IMPORT } from 'soapbox/actions/importer';
Expand Down Expand Up @@ -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);
});
});
});
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down

0 comments on commit 8bcf5fe

Please sign in to comment.