felixge / felixge/node-sandboxed-module

Mocking module scoped variables

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
343
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Is it possible to mock a module scoped variable?

Given the following file. I'd like to change the value of `hello`, to something else.

```js
var hello = 'Hello Sir'

console.log(hello)
```

https://stackoverflow.com/questions/49478755/require-and-overwrite-module-scoped-variable-for-testing

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.