From 3f614a0898eb0d5dfdd52aa17baed1ee3c4503d0 Mon Sep 17 00:00:00 2001 From: bpirkle Date: Tue, 30 Jul 2024 22:11:31 -0500 Subject: 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 --- tests/api-testing/REST/UpdateLegacy.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/api-testing/REST/UpdateLegacy.js (limited to 'tests/api-testing/REST/UpdateLegacy.js') 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 ]; +} ); -- cgit v1.2.3