Commit Graph

35 Commits

Author SHA1 Message Date
David Baker
4b9be2aec4 Remove the karma junit reporter
We may have used it in our jenkins tests at some point but we don't
have those anymore. It weas pulling in ancient dependencies because
we were using version 2.0.0 which is fact much older than the
current version (1.2.0). We have little use for junit output anymore
so just remove it.
2019-05-03 10:39:13 +01:00
Travis Ralston
bdc94f3847 Fix Chrome for Karma 2019-03-13 22:11:45 -06:00
J. Ryan Stinnett
7c947d87ab Update scripts and docs to use yarn where appropriate
Most `npm` operations are replaced with `yarn`, which generally has better
behavior. However, steps like publish that write to the NPM registry are left to
`npm`, which currently handles these tasks best.
2019-03-11 14:22:02 +00:00
J. Ryan Stinnett
8b05cca7d2 Add file-loader to Karma so assets will resolve in tests 2019-01-18 10:55:00 -06:00
Travis Ralston
873133458a Remove the request-only stuff we don't need anymore
This was introduced in https://github.com/matrix-org/matrix-react-sdk/pull/2250 but can be pulled out due to https://github.com/matrix-org/matrix-js-sdk/pull/770. See https://github.com/vector-im/riot-web/issues/7634 for more information about the future.
2018-10-31 13:06:57 -06:00
Travis Ralston
54ff5d8f25 Fix Karma/Webpack so it can build the tests 2018-10-25 15:21:18 -06:00
Marcel
a1dfc6bd25
Remove invalid object in karma webpack config
root is replaced with modules in webpack 4
2018-10-09 17:45:21 +02:00
Marcel
f5012d87cf
Fix karma webpack config 2018-10-09 17:40:25 +02:00
Marcel
10a3f08ee2
Update karma config for webpack 4 2018-10-09 17:32:39 +02:00
Luke Barnard
0118d880ec Attempt to improve test output to be more readable
- Add "logcapture" reporter to capture logs only for failed tests
 - Add "spec" reporter to show each test status individually
 - Add "summary" reporter to show the total number of successful/failed tests
2017-07-27 14:47:22 +01:00
Richard van der Hoff
f69033c907 Use headless chrome instead of phantomjs for tests 2017-07-05 14:39:02 +01:00
Michael Telatynski
9f8b2ba4ba maybe fixxy?
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-01 18:58:07 +01:00
David Baker
e44f3cc709 Fix tests
* Serve translation files from the karma server
 * Port UserSettingsStore to ES6 exports because the test runner
   gets confused by ES6 importing a commonjs module
 * Remove extra spaces in translations strings for MELS
 * Fix 'his/her' back to be 'their'
 * Change test to expect singular 'invitation' for a single person
   (there may be multiple invitations, but IMO this should be
   'rejected n invitations' and we can play with the wording later,
   I don't think the singular is any worse than the plural).
 * set language in the MELS tests (and wait for it to complete)
 * Don't bother setting lang in other tests for now
2017-05-26 11:58:45 +01:00
David Baker
ba8e37a84e Don't include src in the test resolve root
Don't include src in resolve root for the karma test, as otherwise
modules from react sdk get pulled in instead of npm libraries like
'extend' which breaks everything in really subtle ways.
2017-05-25 23:13:49 +01:00
Michael Telatynski
18d933cbe4 Specify cross platform regexes and add olm to noParse
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-22 14:52:20 +01:00
Richard van der Hoff
cd1cf09dc9 Make tests pass on Chrome again
It seems that a number of the tests had started failing when run in
Chrome. They were fine under PhantomJS, but the MegolmExport tests only work
under Chrome, and I need them to work...

Mostly the problems were timing-related, where assumptions made about how
quickly the `then` handler on a promise would be called were no longer
valid. Possibly Chrome 55 has made some changes to the relative priorities of
setTimeout and sendMessage calls.

One of the TimelinePanel tests was failing because it was expecting the contents
of a div to take up more room than they actually were. It's possible this is
something very environment-specific; hopefully the new value will work on a
wider range of machines.

Also some logging tweaks.
2017-01-31 22:40:53 +00:00
David Baker
8c5fde28d1 remove the presets from karma.conf.js
as it seems to pick them up from .babelrc
2016-10-17 16:23:27 +01:00
David Baker
5b4b81f7dc Revert "Switch to babel 6" 2016-10-14 18:49:52 +01:00
David Baker
2873541a1f remove the presets from karma.conf.js
as it seems to pick them up from .babelrc
2016-10-13 09:48:07 +01:00
David Baker
a2b64798f7 Fix timelinepanel test timeout
The previous fix was adjusting the wrong timeout: it's hitting browserNoActivityTimeout, so revert previous fix & do this instead
2016-07-05 14:35:34 +01:00
Richard van der Hoff
9fcf8d00b4 Silence some 404s from the tests
Add an edit.png so we don't get a 404 every time we load some event tiles
2016-04-21 14:23:33 +01:00
Richard van der Hoff
66966eecf8 Make sure we only have one React in tests
Otherwise if we symlink in react-gemini-scrollbar, React gets very confused
2016-04-21 08:10:58 +01:00
Richard van der Hoff
7a821ce9d1 Make it possible to only run one test file each time 2016-04-07 17:49:39 +01:00
Richard van der Hoff
ae1220a6a4 Fix test for npm 3
npm 3 puts files in slightly saner places, so we have to look for the gemini
css in two places
2016-04-05 11:08:02 +01:00
Richard van der Hoff
51fe77122b Fix an issue where the scroll stopped working.
Under certain conditions, it was possible to get stuck in a state where any
user-initiated scroll would be met with "Working around
vector-im/vector-web#528" and overridden. Fix this by removing the duplication
between _lastSetScroll and recentEventScroll, and using _lastSetScroll which is
more reliable.
2016-04-05 10:41:32 +01:00
Richard van der Hoff
73f7528d0f Use babel 5 for karma tests 2016-03-31 16:59:38 +01:00
Richard van der Hoff
dc5c0928b2 Some basic tests for MessagePanel
Check that it puts the read marker in the right place, and check that the
animation works.

... all of which has been surprisingly painful.
2016-03-31 00:48:46 +01:00
Richard van der Hoff
6069812fcf Create Junit reports from karma 2016-03-29 00:12:59 +01:00
Richard van der Hoff
04561ea6e6 Use phantomjs when running a single test 2016-03-29 00:12:59 +01:00
Richard van der Hoff
5f3b82a767 Stub out the matrix client 2016-03-29 00:12:59 +01:00
Richard van der Hoff
7e1e2347b5 Don't need alias for test-component-index 2016-03-29 00:12:59 +01:00
Richard van der Hoff
e428f48269 Source map working 2016-03-29 00:12:59 +01:00
Richard van der Hoff
c516ecebcc No need for .babelrc 2016-03-29 00:12:59 +01:00
Richard van der Hoff
d7801ef3a4 Vaguely working webpack test 2016-03-29 00:12:59 +01:00
Richard van der Hoff
f60dd93660 Initial implementation of some karma/mocha tests
It does something, but things I don't like:

* it churns for 15 seconds webpacking everything. Do we really need to get
  webpack involved here?

* I don't think there's any way to control which tests get run and which don't.

Other things I'd want to fix up include:

* Make it run on jsdom or phantomjs instead of Chrome
* figure out how to configure babel without a .babelrc
2016-03-29 00:12:58 +01:00