AlCalzone
AlCalzone
FYI, you don't lose the typing when you switch to JavaScript. Example: global JS:  non-global TS: 
It was meant to show you that the tooltip contains the correct type without needing to use Typescript.
Turns out, it is as easy as this: ```ts declare module "foo"; ```
JS is valid TypeScript, except it is missing some type annotations, so that doesn't require any major work. Also I'm not talking about conversion or something, just changing the engine...
> Keywords: sinon, proxyrequire exactly :)
The framework is now there with @iobroker/testing, but we need to actually use it :) So I'd leave this open for now
The sandbox is already patching the `require` function, but I'm not sure if/how it is possible to change the global scope of the returned module. Maybe something with `module.createRequire`, but...
There isn't simply a module that defines the functions. They are defined in the sandbox that acts as the context for the Node.js script VM. https://nodejs.org/api/vm.html#scriptruninnewcontextcontextobject-options
Question: Is it possible to have the following situation? ``` (state) -> (name) "foo" -> "bar" "bar" -> "baz" "baz" -> "foo" ``` I would guess not, but that could...
This could be hard or even next to impossible to do. If its used in an adapter, one would have to search the code of that adapter and its modules....