Skip to content

Conversation

@ericsciple
Copy link
Contributor

No description provided.

@@ -1,47 +1,44 @@
import * as assert from 'assert'
import * as core from '@actions/core'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code used genMockModule to hijack the module loader, and then require the module being tested during the beforeAll. The require was deferred to beforeAll because I had found the import order to be unreliable when esModuleInterop is set to true (recommended tsconfig setting).

Switching to spyOn(...).mockImplementation(...) instead, which allows everything to be imported as normal. Rather than late-bound require during beforeAll.

@ericsciple
Copy link
Contributor Author

Going ahead and merging since this is just to align with the pattern established in setup go

@ericsciple ericsciple merged commit 61fd8fd into master Feb 13, 2020
@ericsciple ericsciple deleted the users/ericsciple/m166mock branch February 13, 2020 18:25
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

Successfully merging this pull request may close these issues.

3 participants