You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had one small issue when integrating sls-test-tools into an integration test pack.
When running the test spec against a stack I was getting the following error:
Background to this, previous to adding the integration test suite we had added a unit test suite with mocks for the AWS SDK following this method.
After some experimentation, it seemed the AWS Mocks file for the unit tests was being included in the integration test run, even though our route to the tests was very explicit.
Solution
The most straightforward solution was to have two jest.config.js:
jest.integration.config.js
jest.unit.config.js
In integration test config excludes the mocks:
modulePathIgnorePatterns: ["__mocks__"]
Then we specified which config to run in the package.json:
Background
I had one small issue when integrating
sls-test-tools
into an integration test pack.When running the test spec against a stack I was getting the following error:
Background to this, previous to adding the integration test suite we had added a unit test suite with mocks for the AWS SDK following this method.
After some experimentation, it seemed the AWS Mocks file for the unit tests was being included in the integration test run, even though our route to the tests was very explicit.
Solution
The most straightforward solution was to have two
jest.config.js
:jest.integration.config.js
jest.unit.config.js
In integration test config excludes the mocks:
Then we specified which config to run in the
package.json
:Hope this helps anyone that may run into a similar issue, or if there is a better way of dealing with this?
The text was updated successfully, but these errors were encountered: