Skip to content

Commit

Permalink
dev: upgrade sequelize and improve tests (#2723)
Browse files Browse the repository at this point in the history
* feat(sequelize): create separate sequelize file

* feat(sequelize): do naive migration

* chore(sequelize): add some types packages

* chore(sequelize): add some more types packages

* feat(sequelize): successfully upgrade sequelize?

* chore: improve typesafety for RSS

* chore: add more @types packages

* fix(sequelize): selectively upsert based on collectionId when available

* fix(sequelize): rename exported model in associate method to please eslint

* fix(sequelize): make tests run

* jest >:(

* fix(sequelize): fix facets and searchdata tests

* fix(sequelize): remove esbuild-runner config

* fix(jest): get around jest's override of setimmediate

* fix(jest): fix memory leak issue with sequelize and supertest

* fix(jest): fix memory leak issue with passport and express-slow-down

* feat(jest): add custom test sequencer to sort tests and prioritize customScript tests to run first

* fix(jest): remove unnecessary stuff from test commands

* fix(jest): add @side/jest-runtime to prevent mem leak in node 18

* fix(jest): add proper teardown to tests with setup to prevent memory leak

* chore(package.json): remove supertest-as-promised package from dependencies as it is no longer used in the project

* chore: revert upgrades to ts, prettier, and eslint

* chore: misc test stuff

* fix: upgrade to typescript 4.5 to fix tsc errors in @types/jsdom

* fix: revert eslint error

* fix: fix esoteric eslint issues, to be dealt with later

* fix: ignore weird eslint errors for now

* fix: make jest exit with 0 with duplicate snapshots removed

* chore: bring up to date with #2716 and #2718

* fix: remove unused code

* fix: remove custom sequencer, initialize customScripts featureflag manually

* chore: remove test files

* chore: fix eslint errors
  • Loading branch information
tefkah committed Jun 21, 2023
1 parent 78a13b5 commit 1bb951c
Show file tree
Hide file tree
Showing 154 changed files with 44,716 additions and 36,132 deletions.
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
}
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

0 comments on commit 1bb951c

Please sign in to comment.