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

Upgrade sequelize and improve tests #2723

Merged
merged 36 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c5bdbc7
feat(sequelize): create separate sequelize file
tefkah May 30, 2023
9b0c782
feat(sequelize): do naive migration
tefkah May 30, 2023
47d227a
chore(sequelize): add some types packages
tefkah May 30, 2023
ba62a7f
chore(sequelize): add some more types packages
tefkah May 30, 2023
88cda62
feat(sequelize): successfully upgrade sequelize?
tefkah May 30, 2023
8c3da11
chore: improve typesafety for RSS
tefkah May 30, 2023
5fe7704
chore: add more @types packages
tefkah May 31, 2023
8d287d8
fix(sequelize): selectively upsert based on collectionId when available
tefkah May 31, 2023
fc857d6
fix(sequelize): rename exported model in associate method to please e…
tefkah May 31, 2023
008e3c3
fix(sequelize): make tests run
tefkah May 31, 2023
6cf2593
Merge branch 'mastter' into upgrade-sequelize
tefkah May 31, 2023
6e623c3
jest >:(
tefkah Jun 6, 2023
774724a
fix(sequelize): fix facets and searchdata tests
tefkah Jun 12, 2023
87bcf5f
fix(sequelize): remove esbuild-runner config
tefkah Jun 12, 2023
a77ce86
fix(jest): get around jest's override of setimmediate
tefkah Jun 12, 2023
7cbc968
fix(jest): fix memory leak issue with sequelize and supertest
tefkah Jun 12, 2023
fe39fc5
fix(jest): fix memory leak issue with passport and express-slow-down
tefkah Jun 12, 2023
08501a0
feat(jest): add custom test sequencer to sort tests and prioritize cu…
tefkah Jun 12, 2023
40dbc5d
fix(jest): remove unnecessary stuff from test commands
tefkah Jun 12, 2023
211ae12
fix(jest): add @side/jest-runtime to prevent mem leak in node 18
tefkah Jun 12, 2023
70bd906
fix(jest): add proper teardown to tests with setup to prevent memory …
tefkah Jun 12, 2023
0512de0
chore(package.json): remove supertest-as-promised package from depend…
tefkah Jun 13, 2023
9f5f677
chore: revert upgrades to ts, prettier, and eslint
tefkah Jun 13, 2023
6534eb9
chore: misc test stuff
tefkah Jun 13, 2023
17b80b1
fix: upgrade to typescript 4.5 to fix tsc errors in @types/jsdom
tefkah Jun 13, 2023
3df3bcf
fix: revert eslint error
tefkah Jun 13, 2023
f4f7ca4
fix: fix esoteric eslint issues, to be dealt with later
tefkah Jun 14, 2023
59c2ca1
fix: ignore weird eslint errors for now
tefkah Jun 14, 2023
cc6137f
fix: make jest exit with 0 with duplicate snapshots removed
tefkah Jun 14, 2023
0ed40a7
chore: bring up to date with #2716 and #2718
tefkah Jun 14, 2023
1b84c08
Merge branch 'master' into tfk/upgrade-sequelize
tefkah Jun 14, 2023
8eb815f
fix: remove unused code
tefkah Jun 21, 2023
7dbf0d0
fix: remove custom sequencer, initialize customScripts featureflag ma…
tefkah Jun 21, 2023
8aac024
chore: merge with master
tefkah Jun 21, 2023
fcbf692
chore: remove test files
tefkah Jun 21, 2023
51b9bdf
chore: fix eslint errors
tefkah Jun 21, 2023
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
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"extends": ["airbnb", "prettier"],
"plugins": ["react", "import", "prettier", "react-hooks", "pubpub-rules", "@typescript-eslint", "@blueprintjs"],
"plugins": [
"react",
"import",
"prettier",
"react-hooks",
"pubpub-rules",
"@typescript-eslint",
"@blueprintjs"
],
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
Expand Down
18 changes: 13 additions & 5 deletions .jest/setup-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (typeof document !== 'undefined') {
focusNode: null,
anchorNode: null,
rangeCount: 0,
addRange: () => {},
removeAllRanges: () => {},
addRange: () => { },
removeAllRanges: () => { },
};
};

Expand All @@ -44,8 +44,8 @@ if (typeof document !== 'undefined') {
commonAncestorContainer: {
ownerDocument: document,
},
setStart: () => {},
setEnd: () => {},
setStart: () => { },
setEnd: () => { },
getClientRects: () => [],
getBoundingClientRect: () => ({
left: 0,
Expand All @@ -61,7 +61,15 @@ if (typeof document !== 'undefined') {
}

if (typeof window !== 'undefined') {
window.requestIdleCallback = () => {};
window.requestIdleCallback = () => { };
}

global.fetch = () => new Promise((resolve) => setTimeout(resolve), 1e4);

if (typeof window === 'undefined') {
/**
* This is here because Jest overrides setImmediate in a strange way.
* This fixes @see{../utils/async/__tests__/async.test.ts}
*/
global.setImmediateNode = setImmediate
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a weird issue, maybe introduced in Jest 27+

}
5 changes: 4 additions & 1 deletion client/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ require('./banner.scss');
const Banner = (props: Props) => {
const { bannerText, accentColor, right } = props;

const lighterAccentColor = useMemo(() => Color(accentColor).alpha(0.1), [accentColor]);
const lighterAccentColor = useMemo(
() => Color(accentColor).alpha(0.1).toString(),
[accentColor],
);

return (
<div style={{ background: lighterAccentColor }} className="banner">
Expand Down
Loading