Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

td.replace before it vs td.replace inside of it #394

Closed
nohaibogdan1 opened this issue Nov 22, 2018 · 1 comment
Closed

td.replace before it vs td.replace inside of it #394

nohaibogdan1 opened this issue Nov 22, 2018 · 1 comment

Comments

@nohaibogdan1
Copy link

When I call td.replace(module) outside of it (inside of a describe) node gives this error.
Error: testdouble.js - td.replace - No "undefined" property was found.

The error goes away if I do td.replace(module, 'property')

But inside of it td.replace(module) will work.

@searls
Copy link
Member

searls commented Nov 27, 2018

td.replace should only be used in the context of running a test, so inside an it or beforeEach, but not inside a describe callback (which is suite-definition time, not test-run-time) or at the top of a module (which is module-load-time). See the example in the docs

@searls searls closed this as completed Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants