|
| 1 | +import request from "supertest" |
1 | 2 | import { jest } from "@jest/globals" |
2 | 3 | import app from "../../app.js" |
3 | 4 |
|
@@ -140,130 +141,3 @@ describe("Combined unit tests for the '/delete' route.", () => { |
140 | 141 | expect(exists).toBe(true) |
141 | 142 | }) |
142 | 143 | }) |
143 | | - |
144 | | - |
145 | | -/** |
146 | | - * This test suite uses the built app.js app and checks that the expected create endpoints are registered. |
147 | | - * - /create |
148 | | - * - /app/create |
149 | | - */ |
150 | | -describe("Check that the expected TinyNode create route patterns are registered.", () => { |
151 | | - it("'/app/create' and '/create' are registered routes in the app. __exists __core", () => { |
152 | | - let exists = false |
153 | | - let count = 0 |
154 | | - const stack = expressListEndpoints(app.router) |
155 | | - for (const middleware of stack) { |
156 | | - if (middleware.path && middleware.path.includes("/app/create")) { |
157 | | - count++ |
158 | | - } else if (middleware.path && middleware.path.includes("/create")) { |
159 | | - count++ |
160 | | - } |
161 | | - if (count === 2) { |
162 | | - exists = true |
163 | | - break |
164 | | - } |
165 | | - } |
166 | | - expect(exists).toBe(true) |
167 | | - }) |
168 | | -}) |
169 | | - |
170 | | -/** |
171 | | - * This test suite uses the built app.js app and checks that the expected query endpoints are registered. |
172 | | - * - /query |
173 | | - * - /app/query |
174 | | - */ |
175 | | -describe("Check that the expected TinyNode query route patterns are registered.", () => { |
176 | | - it("'/app/query' and '/query' are registered routes in the app. __exists __core", () => { |
177 | | - let exists = false |
178 | | - let count = 0 |
179 | | - const stack = expressListEndpoints(app.router) |
180 | | - for (const middleware of stack) { |
181 | | - if (middleware.path && middleware.path.includes("/app/query")) { |
182 | | - count++ |
183 | | - } else if (middleware.path && middleware.path.includes("/query")) { |
184 | | - count++ |
185 | | - } |
186 | | - if (count === 2) { |
187 | | - exists = true |
188 | | - break |
189 | | - } |
190 | | - } |
191 | | - expect(exists).toBe(true) |
192 | | - }) |
193 | | -}) |
194 | | - |
195 | | -/** |
196 | | - * This test suite uses the built app.js app and checks that the expected update endpoints are registered. |
197 | | - * - /update |
198 | | - * - /app/update |
199 | | - */ |
200 | | -describe("Check that the expected TinyNode update route patterns are registered.", () => { |
201 | | - it("'/app/update' and '/update' are registered routes in the app. __exists __core", () => { |
202 | | - let exists = false |
203 | | - let count = 0 |
204 | | - const stack = expressListEndpoints(app.router) |
205 | | - for (const middleware of stack) { |
206 | | - if (middleware.path && middleware.path.includes("/app/update")) { |
207 | | - count++ |
208 | | - } else if (middleware.path && middleware.path.includes("/update")) { |
209 | | - count++ |
210 | | - } |
211 | | - if (count === 2) { |
212 | | - exists = true |
213 | | - break |
214 | | - } |
215 | | - } |
216 | | - expect(exists).toBe(true) |
217 | | - }) |
218 | | -}) |
219 | | - |
220 | | - |
221 | | -/** |
222 | | - * This test suite uses the built app.js app and checks that the expected overwrite endpoints are registered. |
223 | | - * - /overwrite |
224 | | - * - /app/overwrite |
225 | | - */ |
226 | | -describe("Check that the expected TinyNode overwrite route patterns are registered.", () => { |
227 | | - it("'/app/overwrite' and '/overwrite' are registered routes in the app. __exists __core", () => { |
228 | | - let exists = false |
229 | | - let count = 0 |
230 | | - const stack = expressListEndpoints(app.router) |
231 | | - for (const middleware of stack) { |
232 | | - if (middleware.path && middleware.path.includes("/app/overwrite")) { |
233 | | - count++ |
234 | | - } else if (middleware.path && middleware.path.includes("/overwrite")) { |
235 | | - count++ |
236 | | - } |
237 | | - if (count === 2) { |
238 | | - exists = true |
239 | | - break |
240 | | - } |
241 | | - } |
242 | | - expect(exists).toBe(true) |
243 | | - }) |
244 | | -}) |
245 | | - |
246 | | -/** |
247 | | - * This test suite uses the built app.js app and checks that the expected delete endpoints are registered. |
248 | | - * - /delete |
249 | | - * - /app/delete |
250 | | - */ |
251 | | -describe("Combined unit tests for the '/delete' route.", () => { |
252 | | - it("'/app/delete' and '/delete' are registered routes in the app. __exists __core", () => { |
253 | | - let exists = false |
254 | | - let count = 0 |
255 | | - const stack = expressListEndpoints(app.router) |
256 | | - for (const middleware of stack) { |
257 | | - if (middleware.path && middleware.path.includes("/app/delete")) { |
258 | | - count++ |
259 | | - } else if (middleware.path && middleware.path.includes("/delete")) { |
260 | | - count++ |
261 | | - } |
262 | | - if (count === 2) { |
263 | | - exists = true |
264 | | - break |
265 | | - } |
266 | | - } |
267 | | - expect(exists).toBe(true) |
268 | | - }) |
269 | | -}) |
0 commit comments