* Skip unwritten tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tidy jest fake timers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary sessionStorage mock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve async assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve error assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve object assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove assertion testing unclear mock
This test failed when ran individually, same as after the clearAllMocks call
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Avoid awaiting non-thenables
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Pass nop function when stubbing out console, vitest won't accept it any other way
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary mock which causes tests to fail after updating fetch-mock & fix typo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix mistaken assertions not testing all values in array
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix hidden non-running tests in room.spec.ts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update fetch-mock-jest to @fetch-mock/jest
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make knip happier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make knip happier 2.0
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Switch from Jest to Vitest
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix CI
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary fake timers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update vite
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert irrelevant changes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix coverage spec paths
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix slow test reporter
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix bad merge conflict resolution
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix babel config
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Skip unwritten tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tidy jest fake timers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary sessionStorage mock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve async assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve error assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve object assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove assertion testing unclear mock
This test failed when ran individually, same as after the clearAllMocks call
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Avoid awaiting non-thenables
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Pass nop function when stubbing out console, vitest won't accept it any other way
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary mock which causes tests to fail after updating fetch-mock & fix typo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix mistaken assertions not testing all values in array
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix hidden non-running tests in room.spec.ts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update fetch-mock-jest to @fetch-mock/jest
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make knip happier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make knip happier 2.0
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This prevents tsc from picking up random types from parent directories
such as in situations like an element-web layered build, and generally
seems like good hygiene as we don't want to pick up random types from
whatever directory we happen to be checked out into.
* Bump ES target version to ES2022
I want to be able to use `WeakRef`, and per
https://github.com/element-hq/element-web/issues/24913#issuecomment-2182448007,
I believe this should be safe.
* room.ts: Fix initialisation order
It seems that ES2022 causes typescript to change the initialization order of
regular properties vs parameter properties
(https://github.com/microsoft/TypeScript/issues/45995), so we need to rearrange
the initializations to avoid an error.
In practice, it might be fine because we have enabled
`babel-plugin-transform-class-properties`, which moves the initialization back
after the parameter property, but we shoudn't rely on that, and anyway it
upsets the linter.
* Initial attempt at CI to annotate new TSC errors
* Make tsconfig file valid
* enable debug
* Specify commit
* Fix commit specification
* Switch back to main
* Tweak permissions
* Add strict mode failure
* Attempt number two
* Fix ts-extra-args
* Add static analysis for tsc --strict
1829 added the spec files to 'src', presumably because they just
were't type checked otherwise, but this chaqnged the implicit rootDir
so the lib directory we shipped has types in src/ and spec/ which
meant lib/index.d.ts was at lib/src/index.d.ts.
Specify the rootDir on the build tsconfig to put it back in the
right place, and also try to make the base tsconfig never emit
to avoid it ever generating .d.ts files in silly places. Move all
the optoins related to emitting to -build since they aren't relevant
in the main one.
Is this a sensible way to do this? It doesn't feel terribly elegant.
Fixes https://github.com/vector-im/element-web/issues/18503
Regressed in https://github.com/matrix-org/matrix-js-sdk/pull/1829
Fixesvector-im/element-web#17743
The package @types/jest was not discovered because if types is specified, only packages listed will be included in the global scope.
Fixes https://github.com/vector-im/element-web/issues/14947
Much like element-web's Jitsi wrapper build steps, this downloads the emoji JSON at build time to ensure it gets reasonably updated. In the future, the spec might want to consider publishing a dedicated i18n package on npm for this, however this is fine for now. We download rather than copy/paste to ensure we always have an updated copy.
We'll let babel decide where best to put the sourcemaps. We previously needed inline sourcemaps for browserify to work, though `babelify` takes care of this now that we use `src/` (without sourcemaps in `lib/` being inline, the transform wouldn't work).
Typescript sourcemaps have also been enabled as a mental reminder that they will be exported. Babel is the only thing that uses the tsconfig for generation right now, and it appears to ignore the sourcemaps field.
For https://github.com/vector-im/riot-web/issues/8880
Features:
* Export modern JS
* Export typings
* Export source maps that actually mean something
* No longer supporting minified builds
This is a step towards being a boring SDK and not anticipating an install location.
This commit requires a major version bump of the SDK.