diff options
author | bpirkle <bpirkle@wikimedia.org> | 2024-07-30 22:11:31 -0500 |
---|---|---|
committer | bpirkle <bpirkle@wikimedia.org> | 2024-08-07 16:51:09 -0500 |
commit | 3f614a0898eb0d5dfdd52aa17baed1ee3c4503d0 (patch) | |
tree | 2619e5e0bbd3c8a6f56836ec1410fb203fba3ae4 /tests/api-testing/REST/UpdateLegacy.js | |
parent | 2be4b150e43a0653f04f5db99555bcc57964d9cb (diff) | |
download | mediawikicore-3f614a0898eb0d5dfdd52aa17baed1ee3c4503d0.tar.gz mediawikicore-3f614a0898eb0d5dfdd52aa17baed1ee3c4503d0.zip |
Add content.v1 REST module with relevant content endpoints
T366837 added the ability to group REST endpoints into modules.
This change now introduces the first use of a REST module.
The existing endpoints remain accessible at their original paths,
and mocha tests are run against both old and new paths.
Bug: T370430
Change-Id: I83a5cdbdd359e4d3e5f70dd3930783616b556738
Diffstat (limited to 'tests/api-testing/REST/UpdateLegacy.js')
-rw-r--r-- | tests/api-testing/REST/UpdateLegacy.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/api-testing/REST/UpdateLegacy.js b/tests/api-testing/REST/UpdateLegacy.js new file mode 100644 index 000000000000..e9e0e5b14920 --- /dev/null +++ b/tests/api-testing/REST/UpdateLegacy.js @@ -0,0 +1,10 @@ +'use strict'; + +describe( 'legacy PUT /page/{title}', () => { + // Cache deletion ensures tests will execute for both legacy and module paths + // Doing this twice protects against changes in test execution order + const testsFile = __dirname + '/content.v1/Update.js'; + delete require.cache[ testsFile ]; + require( testsFile ).init( 'rest.php/v1' ); + delete require.cache[ testsFile ]; +} ); |