Commit graph

137 commits

Author SHA1 Message Date
Pavel Djundik fb17107406
Increase test timeout on CI 2018-02-28 22:42:21 +02:00
Jérémie Astori ecede860ef
Enable in-browser run of client testing
This gets us one step closer to cross-browser testing 🎉
2018-02-23 23:52:36 -05:00
Pavel Djundik 59ec07be87
Update all links to thelounge repository 2018-02-21 22:47:52 -05:00
William Boman acb6179b30 relay client's preferred language in link preview requests
Closes #1440.
2018-02-21 10:35:33 +01:00
Jérémie Astori 9c4ea85041 Instrument client code before running tests
Despite being a bit gross to look at, this brings a few advantages:

- Tests are now closer to what actually runs, so more likely to find broken stuff.
- We can start using things that were so far Webpack-only or browser-only, like ES6 imports, loading Handlebars templates, etc.
- We open ourselves to browser testing (there is some work to do, but that would be a necessary step).
- We improve the client/server separation, by making it possible to run them independently

I do some extra steps around coverage: now we have 2 reports (client + server), so I have an extra step to combine them (the `nyc report` part). This is  strictly to keep feature parity (the coverage report of this code is effectively the same as before), but in the near future, we might want to keep both reports separate, for example to continue separating client/server. Another reason would be to use something like Codecov, which I believe has the ability to have multiple reports. This is down the road though, our coverage is not good enough to make hosting them somewhere be useful (I think).

A few extras with this commit:

- Coverage summary is displayed when tests are run (this is not slowing down tests)
- Tests check for leaks (see https://mochajs.org/#--check-leaks)
- Tests now output with the `dot` reporter. This is nice as `npm test` runs in parallel, the whole output holds in a few lines instead of spanning over multiple screens.
2018-02-20 15:32:30 +02:00
Pavel Djundik c733e72e7a Auto-fix code for padding-line-between-statements rule 2018-02-20 09:28:04 +02:00
Pavel Djundik 51684f7a2a Switch default home location to ~/.thelounge and remove support of .lounge_home 2018-02-19 20:43:53 +02:00
Pavel Djundik c97352905d
Merge pull request #1962 from thelounge/xpaw/no-var
Enable no-var rule
2018-02-19 20:12:31 +02:00
Pavel Djundik 8886459be9
Merge pull request #2049 from thelounge/xpaw/ui-network-status
Sync network status and security to client UI
2018-02-19 19:57:36 +02:00
Pavel Djundik a3e448acf5 Enable no-var rule
Fixes #1961
2018-02-19 19:49:39 +02:00
Jérémie Astori 8403d277b4
Replace reference to website with new URL 2018-02-19 12:23:41 -05:00
Pavel Djundik 742929280d
Merge pull request #1919 from thelounge/yamanickill/image-size-error
Show error if image is greater than max prefetch size
2018-02-19 18:49:18 +02:00
Pavel Djundik b82ceb162b
Merge pull request #2059 from thelounge/xpaw/motd
Render MOTD with a single message
2018-02-19 18:42:16 +02:00
Jérémie Astori 416f45d1e3 Use some ES6/Node v4-only syntax when possible 2018-02-19 18:30:00 +02:00
Pavel Djundik b57830b859 Sync network status and security to client UI
Co-Authored-By: Jérémie Astori <astorije@users.noreply.github.com>
2018-02-19 13:12:01 +02:00
Pavel Djundik d1e5a8f492 Render MOTD with a single message 2018-02-14 11:00:46 +02:00
Pavel Djundik 116a73c8d0 Remove actionTypes and check templates directly 2018-02-14 11:00:45 +02:00
Pavel Djundik 7e704b2d73 Track channel state to allow removing channels user is not in 2018-02-13 12:30:26 +02:00
Pavel Djundik 4639a2528d
Merge pull request #2021 from thelounge/xpaw/ldapjs-no-dtrace
Use forked ldapjs to remove dtrace
2018-02-13 11:58:25 +02:00
Jérémie Astori 2c570fa9ef
Load packages from package.json, fix loading thelounge metadata from the wrong file, add tests 2018-02-13 01:06:31 -05:00
Pavel Djundik aee1ec2739 Fix crash when hostname is changed in lockNetwork mode
Fixes #2040
2018-02-07 12:03:25 +02:00
Pavel Djundik c4f6701d65 Use forked ldapjs to remove dtrace
Fixes #1756
2018-02-06 13:21:59 +02:00
Jérémie Astori 91e3ca88bb
UI for "Image too large" errors 2018-02-01 21:14:37 -05:00
Jérémie Astori c605f35335
Merge pull request #2019 from thelounge/yamanickill/save-queries
Save query channels in user.json
2018-01-30 19:27:28 -05:00
Al McKinlay 5cf24b80e6 Save query channels in user.json 2018-01-30 17:14:51 +00:00
Jérémie Astori 33d82287be
Do not statically serve the index template prior to rendering it
Without this, going to `https://thelounge.example.com/index.html` would return the raw file. This now excludes it from the `public` folder so it cannot be rendered as is.
Renaming the file is for good measure, to indicate that this HTML file must be templated. Because it is a straight rename with no modification, rebasing PRs on it should not be to painful, as git re-applies changes on renamed files.
2018-01-14 13:02:27 -05:00
Pavel Djundik 6675ced196 Store images with correct file extension 2018-01-03 13:33:52 +02:00
Pavel Djundik 349136f172 Do not match nicknames incorrectly as part of a bigger word
Fixes #1776
Fixes #1885
2017-12-27 20:44:59 +02:00
Pavel Djundik 06becc798f
Merge pull request #1874 from thelounge/astorije/handlebars-notEqual
Add a `notEqual` block helper for Handlebars and tests for `equal`
2017-12-22 12:28:15 +02:00
Jérémie Astori 371c5bcac2
Add a notEqual block helper for Handlebars 2017-12-21 22:09:08 -05:00
Jérémie Astori 6d053d65e7
Add tests for the Handlebars helper equal 2017-12-21 20:09:12 -05:00
Jérémie Astori f975426c61
Rename the error handlers file at loading time 2017-12-21 18:23:54 -05:00
Pavel Djundik e1ae339190 Add test for extended colors 2017-12-12 20:06:37 +02:00
Jérémie Astori df2787d3e9
Add a --config / -c option to the start CLI command to arbitrarily override any configuration key
The biggest caveat is that JS code (such as functions) will not be interpreted as such, on purpose, for security precautions. If such thing is needed, then a configuration file must be used.
2017-12-11 23:48:52 -05:00
Jérémie Astori b90c224a99
Define a raw logger to avoid using console.log, use it in extra help for environment variables, and add a test for this
This has multiple benefits:

- Respects the "Do not mock what you do not own" principle, instead we mock `log.raw` when necessary
- Lets us not re-assign `console.log`, which breaks as Mocha uses `console.log` as well
- Save and restore initial `log.raw` in test hooks (before/after), otherwise this would break Mocha/Chai
2017-12-11 23:48:51 -05:00
Pavel Djundik 4e6a29db35
Merge pull request #1797 from grissly-man/master
#1793 - implement reverse style
2017-12-10 16:15:40 +02:00
Jérémie Astori c2243ed7b4
Remove dead code in tests, and fix a link test
I used `npm run coverage` while *not* excluding the test folder to detect dead code in our test folder, it is actually pretty useful to do so (as a one-shot, not to do that in our config).
Only remaining unreached path is L40 in `test/plugins/auth/ldap.js`, but it does seem to me that it might be useful in case of failures, so I preferred to leave it there.
2017-12-09 18:56:05 -05:00
Jérémie Astori 844ca1fbe6
Merge pull request #1811 from thelounge/astorije/improve-helper
Clean up path helpers, expand defaults location in `thelounge --help`, add tests for `expandHome`
2017-12-08 21:53:14 -05:00
Jérémie Astori 22237658cb
Add some unit tests for Helper.expandHome 2017-12-08 19:50:32 -05:00
Pavel Djundik b391b87e29 Clean monospace and strikethrough formatters 2017-12-08 21:09:23 +02:00
Logan Griswold fb94ad4205 implement reverse formatting with tests
implement reverse formatting with tests
2017-12-07 18:27:59 +00:00
Pavel Djundik 2d0ddfb2e8
Merge pull request #1778 from thelounge/xpaw/lazy-init
Heavily improve performance of "init" event
2017-12-05 12:03:01 +02:00
Logan Griswold f07c1bef69
#1755 - implement monospace formatting with keybinding, tests, and help section 2017-12-03 15:10:46 -05:00
Logan Griswold 0643d3b4a3
#1754 - implement strikethrough formatting, client keybinding, tests, and help section 2017-12-03 15:10:34 -05:00
Pavel Djundik 5fc70397a9 Make sure all joins send filtered clone 2017-12-03 16:31:37 +02:00
Pavel Djundik fe1c7612f5 Add tests for getFilteredClone methods 2017-12-03 16:31:37 +02:00
Pavel Djundik 52b234bdfc
Merge pull request #1770 from thelounge/astorije/client-tests
Add a bunch of client tests
2017-12-01 12:51:13 +02:00
Jérémie Astori f368dcdc69
Add a bunch of client tests 2017-11-30 20:33:23 -05:00
Pavel Djundik d770028da6 Fix duplicate user names not being found 2017-11-30 14:16:11 +02:00
Jérémie Astori 4ec10b922a
Clone instances of User in Msg to avoid unintentional mutations 2017-11-30 00:41:19 -05:00