* Construct a ServiceTester instance for a single service class * * @param {Function} ServiceClass * A class that extends base-service/base.BaseService * @returns {module:core/service-test-runner/service-tester~ServiceTester} * ServiceTester for ServiceClass
(ServiceClass)
| 50 | * ServiceTester for ServiceClass |
| 51 | */ |
| 52 | static forServiceClass(ServiceClass) { |
| 53 | const id = ServiceClass.name |
| 54 | const pathPrefix = ServiceClass.route.base |
| 55 | ? `/${ServiceClass.route.base}` |
| 56 | : '' |
| 57 | return new this({ |
| 58 | id, |
| 59 | title: id, |
| 60 | pathPrefix, |
| 61 | }) |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Invoked before each test. This is a stub which can be overridden on |
no outgoing calls
no test coverage detected