discourse/lib/tasks
Osama Sayegh a53d8d3e61
FEATURE: Introduce theme/component QUnit tests (#12517)
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests).

Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.

You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:

* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.

* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.

There are some refactors to internal code that's responsible for processing themes/components in Discourse, most notably:

* `<script type="text/discourse-plugin">` tags are automatically converted to modules.

* The `theme-settings` service is removed in favor of a simple `lib` file responsible for managing theme settings. This was done to allow us to register/lookup theme settings very early in our Ember app lifecycle and because there was no reason for it to be an Ember service.

These refactors should 100% backward compatible and invisible to theme developers.
2021-04-07 10:39:57 +03:00
..
add_topic_to_quotes.rake
admin.rake DEV: Rake task for creating admin should ask for full name if required (#11096) 2020-11-02 11:12:42 +01:00
api.rake
assets.rake FIX: correct cdn path (#11324) 2020-11-23 13:03:49 +11:00
auto_annotate_models.rake
autospec.rake
avatars.rake
backfill.thor
bookmarks.rake Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse"" 2020-05-23 00:56:13 -04:00
build_test_topic.rake
build.rake
categories.rake
cdn.rake
db.rake FIX: rake db:validate_indexes was broken (#12463) 2021-03-24 08:53:01 +11:00
destroy.rake
docker.rake REFACTOR: Move javascript tests inside discourse app 2020-10-02 11:29:36 -04:00
emails.rake FIX: emails.rake-use domain when sending mail test (#12188) 2021-02-23 14:16:51 -03:00
emoji.rake DEV: Remove JoyPixels emoji option (#12197) 2021-02-26 07:44:52 -05:00
export.rake FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
groups.rake
i18n.rake
images.rake
import.rake FEATURE: add new user option skip_new_user_tips. (#10437) 2020-08-14 19:10:56 +05:30
incoming_emails.rake
integration.rake
javascript.rake DEV: Fix build due to highlight.js branch issue (#12441) 2021-03-18 18:21:23 -04:00
log.rake FIX: whoops, linting 2020-09-03 12:10:11 +01:00
maxminddb.rake
plugin.rake DEV: log rake plugin:update_all plugin_path on error (#12100) 2021-02-16 11:50:27 -08:00
populate.thor
posts.rake DEV: ensure 'posts:reorder_posts' rake task work on single topic 2020-08-04 14:57:49 +02:00
qunit.rake FEATURE: Introduce theme/component QUnit tests (#12517) 2021-04-07 10:39:57 +03:00
redis.rake
release_note.rake Include UI commits when generating release notes. (#12127) 2021-02-18 10:53:23 -05:00
rspec.rake
s3.rake FIX: S3 rake task can ignore yarn.lock 2020-04-29 13:14:04 -04:00
scheduler.rake
search.rake
site_settings.rake
smoke_test.rake Dev: --dev option does nothing in yarn (#12032) 2021-02-10 19:19:47 -05:00
svg_icons.rake
tags.rake FEATURE: Support append when bulk tagging via rake (#9978) 2020-06-04 09:33:48 -04:00
themes.rake FEATURE: Introduce theme/component QUnit tests (#12517) 2021-04-07 10:39:57 +03:00
topics.rake
turbo.rake
typepad.thor FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
uploads.rake FIX: uploads:fix_missing_s3 rake task used wrong SHA1 (#12495) 2021-03-25 11:35:29 +01:00
users.rake