From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- browser/components/newtab/docs/v2-system-addon/preferences.md | 2 +- .../components/newtab/docs/v2-system-addon/unit_testing_guide.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'browser/components/newtab/docs/v2-system-addon') diff --git a/browser/components/newtab/docs/v2-system-addon/preferences.md b/browser/components/newtab/docs/v2-system-addon/preferences.md index ec6ba82491..d709e830e4 100644 --- a/browser/components/newtab/docs/v2-system-addon/preferences.md +++ b/browser/components/newtab/docs/v2-system-addon/preferences.md @@ -43,7 +43,7 @@ pref in the following files: You can see an example in [this patch](https://github.com/mozilla/activity-stream/pull/2977). -## Reading, setting, and observing preferences from `.jsm`s +## Reading, setting, and observing preferences from `.sys.mjs`s To read/set/observe Activity Stream preferences, construct a `Prefs` instance found in `lib/ActivityStreamPrefs.sys.mjs`. diff --git a/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md b/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md index c3dd369a2d..bc0b2e8b53 100644 --- a/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md +++ b/browser/components/newtab/docs/v2-system-addon/unit_testing_guide.md @@ -4,7 +4,7 @@ Our unit tests in Activity Stream are written with mocha, chai, and sinon, and run with karma. They include unit tests for both content code (React components, etc.) -and `.jsm`s. +and `.sys.mjs`s. You can find unit tests in `tests/unit`. @@ -32,7 +32,7 @@ If you are creating a new test, add it to a subdirectory of the `tests/unit` that corresponds to the file you are testing. Tests should end with `.test.js` or `.test.jsx` if the test includes any jsx. -For example, if the file you are testing is `lib/Foo.jsm`, the test +For example, if the file you are testing is `lib/Foo.sys.mjs`, the test file should be `test/unit/lib/Foo.test.js` ## Mocha tests @@ -96,9 +96,9 @@ assert.isUserEventAction({type: "FOO"}); assert.isUserEventAction(ac.UserEvent({event: "BLOOP"})); ``` -## Overriding globals in `.jsm`s +## Overriding globals in `.sys.mjs`s -Most `.jsm`s you will be testing use `Cu.import` or `XPCOMUtils` to inject globals. +Most `.sys.mjs`s you will be testing use `Cu.import` or `XPCOMUtils` to inject globals. In order to add mocks/stubs/fakes for these globals, you should use the `GlobalOverrider` utility in `test/unit/utils`: -- cgit v1.2.3