I'm trying to do some slightly more complex mocking by using the '@imposter-js/types' library in a built index.js file but am finding that I don't have access to the context.operation object under the Graal interpreter.
Trying to log it out gives me 14:06:34 INFO s./opt/imposter/config/mock-responses - Operation function () { [native code] } - where 'Operation' is a string prefix on the log line. This tells me it's there but it does not behave as I'd expect as trying to use context.operation.operationId does not work.
It looks like the '@imposter-js/types' library does not natively export the context here annoyingly but in this case I think that just results in a lack of autocomplete when editing.
EDIT
I've just discovered that I can instead use the getOperationId() method (after editing my custom types) and this works.
I'm trying to do some slightly more complex mocking by using the '@imposter-js/types' library in a built index.js file but am finding that I don't have access to the
context.operation
object under the Graal interpreter.Trying to log it out gives me
14:06:34 INFO s./opt/imposter/config/mock-responses - Operation function () { [native code] }
- where 'Operation' is a string prefix on the log line. This tells me it's there but it does not behave as I'd expect as trying to usecontext.operation.operationId
does not work.It looks like the '@imposter-js/types' library does not natively export the context here annoyingly but in this case I think that just results in a lack of autocomplete when editing.
EDIT I've just discovered that I can instead use the getOperationId() method (after editing my custom types) and this works.